Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Remove all lines from a file that begin with "Page"

Aug
2,818
147
After converting a 31 page .pdf invoice to 31 .csv files,
and combining the 31 .csv files into one .csv file;
Code:
do file in page??.csv (type %file >> holstein.csv)
I needed to remove the 31 headers from each of the 31 pages,
now in the holstein.csv file.

Code:
findstr /R /I /V "^Page" holstein.csv > holstein.out

/R —> use regex
/I —> ignore case (optional)
/V —> exclude matching lines
^Page matches lines starting with "Page"

Just posting this here for my future reference,
and for anyone else who may find this useful.

Ref: Findstr - Search for strings - Windows CMD - SS64.com

Joe
 
Back
Top