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!

Copy multiple files in one file

Status
Not open for further replies.

msen

IS-IT--Management
Apr 24, 2001
36
US
How would I copy multiple file in one file ? Need urgent help.
 
Try something like this:
Code:
cat file1 file2 ... fileN >outputfile

Hope This Help
PH.
 
I tried the suggestion. It is being copied as a continuous string. I want each file to be copied on a new line in the outfile.
 
And this ?
Code:
for f in file1 file2 .... fileN
do
  cat $f
  echo 
done >outfile
Seems the contents of your input files are not LF terminated.

Hope This Help
PH.
 
Hi:

I'm not certain what you want your output to look like, but have you considered using xargs:

cat file1 file2|xargs -n1 > newfile

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top