Computing.Net > Forums > Programming > Append Multiple .txt files (batch)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Append Multiple .txt files (batch)

Reply to Message Icon

Name: gometro33
Date: July 20, 2006 at 04:30:40 Pacific
OS: xp
CPU/Ram: 3ghz/1gB
Product: self built
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: July 20, 2006 at 05:22:54 Pacific
Reply:

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



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

M2



0

Response Number 2
Name: Shr0Om
Date: July 20, 2006 at 07:23:08 Pacific
Reply:

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

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

Does the same trick..


0

Response Number 3
Name: gometro33
Date: July 20, 2006 at 09:05:31 Pacific
Reply:

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


0

Response Number 4
Name: Mechanix2Go
Date: July 20, 2006 at 10:00:20 Pacific
Reply:

copy *.txt big.txt

tends to get wrapped around the axle.


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

M2



0

Response Number 5
Name: Shr0Om
Date: July 20, 2006 at 17:35:51 Pacific
Reply:

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..


0

Related Posts

See More



Response Number 6
Name: Mechanix2Go
Date: July 20, 2006 at 18:18:51 Pacific
Reply:

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



0

Response Number 7
Name: gometro33
Date: July 20, 2006 at 19:30:30 Pacific
Reply:

Ok, that makes sense. Thanks again.

-Matt


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Append Multiple .txt files (batch)

Batch created multiple .txt files www.computing.net/answers/programming/batch-created-multiple-txt-files/17905.html

Split txt file after a given word www.computing.net/answers/programming/split-txt-file-after-a-given-word/20129.html

Merge txt files without appending www.computing.net/answers/programming/merge-txt-files-without-appending/13476.html