how to append text files to a bigger file?

Status
Not open for further replies.

forever

filth is me
hello friends. i have a query. i have 16 text files(.txt) and i want to make one big text file with all the files appended into one big file, like if there is l1.txt ...l16.txt, i want one l.txt = l1+l2+..l16, pardon the bad expression, is this possible? please suggest something, thank you :)
 

blueshift

Wise Old Crow
Yes you can..using Command windows.

Goto Run>cmd. Then go to the location where your txt files are located using cd command. Then give the command:
copy /y 1.txt+2.txt+3.txt final.txt
final.txt is the name of final txt file.
 

ilugd

Beware of the innocent
first of all, back up your files somewhere else, then try
(I assume you are using windows-type this in the command line)
copy 1.txt + 2.txt + .... + 16.txt 1.txt

oops.. I guess I didn't refresh to check if the post was updated.
 
Last edited:

Styler0001

Right off the assembly line
sakumar79 said:
Actually, if you can use wildcards * and ? too, so you can do "copy *.txt new.txt".

This worked for me. But is there a way to append some text between each text file? If TEXT1.TXT has the following as its content:

cars
bikes
scooters

and TEXT2.TXT has:

planes
trains
automobiles

can it be made to output:

cars
bikes
scooters
------------------------------
planes
trains
automobiles

Otherwise, it just crams each file together and makes it hard to differentiate between each one.

The reason I ask is because I've got a couple hundred text files I want to merge and doing it by hand is going to be quite time-consuming.
 

ilugd

Beware of the innocent
create a new file called spacer.txt and do a copy like this
copy 1.txt + spacer.txt + 2.txt full.txt
 

Styler0001

Right off the assembly line
That's not really feasible. As I said in the last sentence, I've got a couple HUNDRED text files I need to merge.
 

ilugd

Beware of the innocent
you will need to do batch scripting. something like shell scripting.
 
Last edited:
Status
Not open for further replies.
Top Bottom