FINDSTR - Command Prompt - Cleaned all "junk" out of .txt file. Now how to remove spaces, eg, blank rows?
Well, I believe the title says it all.

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

FINDSTR - Command Prompt - Cleaned all "junk" out of .txt file. Now how to remove spaces, eg, blank rows?
===

Well, I believe the title says it all.

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
