Posted by: Ian | October 26, 2007

Handy little batch file

Just found a really easy way of combining multiple text files into one large one. Ideal for combining multiple logs together.

dir *.txt /b >> filelist.txt
FOR %%1 in (*.txt) do type %%1 >> c:\filename.txt

Firstly it reads a directory and pipes out the results to filelist.txt.  Then it reads the contents of each file and types it out to c:\filename.txt.  Easy and quick.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories

%d bloggers like this: