Results 1 to 3 of 3
pardon me for asking this simple question, but how do we join multiple files?
I have files like file1.dat, file2.dat, file3.dat........file1000.dat and i want to join all these files into ...
- 10-04-2007 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 1
joining multiple files
pardon me for asking this simple question, but how do we join multiple files?
I have files like file1.dat, file2.dat, file3.dat........file1000.dat and i want to join all these files into one file. How do i do it?
please help
thank you
- 10-04-2007 #2Just Joined!
- Join Date
- Aug 2007
- Posts
- 37
If your files had been named in alphabetical order (file0001.dat, file0002.dat, file0003.dat....file1000.dat) you could just use:
But, as your files are currently named, that will join them together in the wrong order.Code:cat file*.dat >all_files.dat
The solution is to do this:
Code:for x in {1..1000}; do cat file${x}.dat >>all_files.dat; done
- 01-12-2009 #3Just Joined!
- Join Date
- Jan 2007
- Posts
- 1
Thank you
Hi Jozyba,
Thanks for your answer, I used it to join serveral AVI files.


