for take off lines with <<

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
 
F

foxidrive

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top