for take off lines with <<

  • Thread starter Thread starter Jean Pierre Daviau
  • Start date Start date
J

Jean Pierre Daviau

Hi,

What would be a for loop extraxting lines beginning with one or more <
in a news email.
Echoing the remaining lines in a new file?
in fact I suppose I would have to use for /F %%i ('find /V"<"
myfile.txt') do echo %%i>>mytext.txt

or simply
find /V "<" myfile.txt >> newfile.txt

Thanks,
Jean Pierre Daviau

I sent it anyway because the find line works! For . . . once. Ha ha
 
What would be a for loop extraxting lines beginning with one or more <
in a news email.
Echoing the remaining lines in a new file?

Your code will miss lines like this where the < is not at the beginning
and lines line this too : and now for <something> completely different...

This will work however, as it uses regular expressions to filter out lines
beginning with < (the ^ indicates in a regular expression that it is the
beginning of a line).

findstr /r /v "^<" myfile.txt >newfile.txt
 
Back
Top