Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cat 2 files together

Status
Not open for further replies.

ianicr

IS-IT--Management
Nov 4, 2003
230
GB
Is there another way to cat a file on the end of another file? I've got 5 700mb files that I need in 1. I've done a cat file1 file2 file3 file4 file5 >>new but this takes forever... Is there a quicker way?
 
Do some very, very low level programming and change the file inodes directly.

If you manage to do this would you be so kind as to post the code here.




Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
cat concatenates multiple files into a single file.
tar creates an archive file containing multiple files.

the result is not the same.

Jean Pierre.
 
I'm using cygwin. Tar -Af concatenates files. Not sure if this is any quicker than using cat though...
 
I you're in a windows environment, you can do

copy /b file1+file2+file3+file4+file5 newfile

Greg.
 
ianicr,
cygwin tar (like others) start files into the archive on block bundary.
try this :
tar -Af target_file file

Jean Pierre.
 
ianicr,
cygwin tar (like others) start files into the archive on block boundary. Before appending a new file to the archive, tar padd the block with null characters.

try this :
tar -Af target_file file1 file2 file3
less target_file
or od -cx target_file

Jean Pierre.
 
You could try pr

or just run in background

cat file1 file2 >> file3 &



--
| Mike Nixon
| Unix Admin
|
----------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top