I have printed a report off of a legacy pos software system, but instead of actually printing it, i have sent this information to a text file instead.
I have used findstr in command prompt with the /v option to print all of the rows that do not contain the excess "junk", i have then exported this data to another text file, that has been "cleaned".
The problem is that I am still left with many blank rows in this file. My next objective would be to remove these spaces, or blank rows, from the text file, using something similiar to findstr.
Could anyone possibly assist me in a solution with this one?
Here is the findstr script to remove the junk, out of interest sake, for anyone interested.
@echo off
type spooler.txt | findstr /v [=====] | findstr /v [-----] | findstr /v DEPT | findstr /v DESCRIPTION > output.txt
This results in the data held in spooler.txt being read and filtered to not contain any rows that match any of the strings following /v. The output of this is then made into a new text file, output.txt
Solved my own problem with this batch:
@echo off
del update.txt
type spooler.txt | findstr /v ===== | findstr /v DEPT | findstr /v TOWNAME | findstr /v FROM | findstr /v DESCRIPTION | findstr /v (Incl) | findstr /v /c:---- > output.txt
For /F "tokens=* delims=" %%A in (output.txt) Do Echo %%A >> cleaned.txt
type cleaned.txt | findstr /v ECHO > update.txt
del output.txt
del cleaned.txt