Monday, November 9, 2009

Appending files in DOS

Today I used a command to append all files in a directory to a single file. I was working on consolidating all .xsd files in to a single one and found this command helpful.

for %f in (*.xsd) do type %f >> aggregate.txt

This will append all files with .xsd extension in the directory in which the command is run and to aggregate.txt. You can use the aggregate file to do searches/etc. I'm not sure if there's a better way to do this but this was simple and quick.

No comments:

Post a Comment