How to delete specific lines

Asus F3ka-x3 notebook
May 13, 2010 at 11:33:43
Specs: Windows 7, 3GB
Need help with writing a batch file or a simple VBS script to delete certain lines in a text file. Lines of text documents are my type:

C: \ xxx \ xxx \ Anything - delete
C: \ xxx \ xxx \ anythingt.pdf - keep
C: \ xxx \ xxx \ anything.jpg - keep
C: \ xxx \ xxx \ Anything - delete
Necessarily need to delete all the rows that do not have to end their pre-selected word endings such as jpg, jpeg, raw, pdf, bmp, doc, etc. Because it can increase the number of endings, so I simply add the script. Warning: rows, ending with the end containing said pathnames are always different. Also, the number of rows is always different.
Thanks to all for your help!

See More: How to delete specific lines

Report •

May 13, 2010 at 12:07:08
i would suggest using findstring and end-of-line spec:
findstr /i /e ".jpg .bmp .doc .pdf" file.txt > newfile.txt

Report •
Related Solutions

Ask Question