Append Multiple .txt files (batch)

self built
Vote Down
Score
1
Vote Up
July 20, 2006 at 04:30:40 Pacific
Specs: xp, 3ghz/1gB

Basically, I have 100 or so rather long .txt files that I want to make into one file. I tried

"file1.txt file2.txt > newfile.txt"

but it only works for 2 files at a time. Is there a way to do it recursivley (or otherwise) to cut down the time? Thanks

-Matt


Reply ↓  Report •


#1
Vote Down
Score
13
Vote Up
July 20, 2006 at 05:22:54 Pacific

copy *.txt big.one
ren big.one big.txt



=====================================
If at first you don't succeed, you're about average.

M2



Reply ↓  Report •

#2
Vote Down
Score
6
Vote Up
July 20, 2006 at 07:23:08 Pacific

M2: Nifty.. I never thought about that.
I always used:

for %i in (*.txt) do type %i >>BigFile.txt

Does the same trick..


Reply ↓  Report •

#3
Vote Down
Score
0
Vote Up
July 20, 2006 at 09:05:31 Pacific

You're life savers, thanks so much.

Out of curiosity though, why can't you do "copy *.txt big.txt"?

Why do you have to do the rename?

Thanks again.

-Matt


Reply ↓  Report •

#4
Vote Down
Score
5
Vote Up
July 20, 2006 at 10:00:20 Pacific

copy *.txt big.txt

tends to get wrapped around the axle.


=====================================
If at first you don't succeed, you're about average.

M2



Reply ↓  Report •

Related Posts

#5
Vote Down
Score
0
Vote Up
July 20, 2006 at 17:35:51 Pacific

That means that big.txt would be included in big.txt

(Not tested, but 99% likely afaik)...

The easiest way to understand the difference is to just try it..


Reply ↓  Report •

#6
Vote Down
Score
3
Vote Up
July 20, 2006 at 18:18:51 Pacific

A little casual testing in w2k seems to indicate that CMD is smart enough to avoid this. But in DOS, IIRR [if I remember right] it's as Shroom says.


=====================================
If at first you don't succeed, you're about average.

M2



Reply ↓  Report •

#7
Vote Down
Score
2
Vote Up
July 20, 2006 at 19:30:30 Pacific

Ok, that makes sense. Thanks again.

-Matt


Reply ↓  Report •

Reply to Message Icon Start New Discussion
« Batch with changing varia... Adding .1 to file names t... »

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.

Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC