Batch file to edit text files.

September 27, 2010 at 13:07:02
Specs: Windows XP, 512mb
Hi guys, I googled and searched this site for an answer, but as I am not particularly skilled with batch files, I wasn't able to solve my problem.

I have a pc on my network that holds a couple of large hard drives, and on the desktop I have a batch file I created that pipes the contents of each drive into separate text files. The batch contains several lines, each pointing to a different drive and a different resulting text file, such as this:

dir E:\files /s /w > c:\lists\E.txt
dir F:\files /s /w > c:\lists\F.txt

and so on.

What I would like to do is create a separate batch that will take the resulting text files and clean them up a bit. Basically remove all unnecessary and unsightly lines.

Examples of things I'd like removed:

" Volume in drive F is Fdrive
Volume Serial Number is ****-****"


"Directory of F:\folderone"

There are others, but I'm sure this is sufficient.

Is there a way to remove that stuff using < or edlin?
These are both new commands to me, so forgive me if I am way off.
I just want some thinner text files as my end result, so if anyone has a completely different approach to me getting lists of my files in a nice readable format, that would also be appreciated.

Thanks for your time.

See More: Batch file to edit text files.

Report •

September 27, 2010 at 13:53:43
It is difficult to get nice readable list. I may have hundreds of directories and thousands of files. Sometimes I think a database might be the best, Then you can sort and select by different criterea.

Report •

September 30, 2010 at 06:46:12
Have you tried the output of :
dir E:\files /s /b > c:\lists\E.txt

Report •

Related Solutions

Ask Question