Merge .txt files

Solved
Narayan -  
brucine Posted messages 24390 Registration date   Status Membre Last intervention   -
Hello,

I would like to know if there is a command (included in a batch) to merge .txt (or other) files into a single file.

Thank you

Narayan

10 réponses

Galinette
 
The simplest way to merge the contents of two ASCII text files:

File1.txt
File2.txt

type *.txt >> file.res

ren file.res file.txt

I’m posting this here because every time I need it, I search for this tip and can't find it anywhere!

But I allow others to read this message, I'm not a rat ;-)

Galinette
62
saju
 
Hello,

I don't understand how to use your tip? Could you please explain it in detail? I have txt files in Windows that I need to merge.

Thank you in advance.

sarah
0
brucine Posted messages 24390 Registration date   Status Membre Last intervention   4 098 > VM
 

Apparently you are practicing copy syntax, but still not how to say Hello.

Obviously your second syntax will work because we didn’t select all files (*), only those starting with 23 (but not 23.txt), and we are not concatenating into a directory but into a file.

If we apply a syntax like type *.txt>>test.txt while the file test.txt already exists, we will have an additional problem...

1