The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Concatenate a file with another file. Soumya Dash Shell Programming and Scripting 4 08-09-2008 07:25 AM
How to create concatenate a file in tab format ahjiefreak UNIX for Dummies Questions & Answers 12 12-11-2007 05:22 PM
Concatenate 2 rows into 1 row indianadoug Shell Programming and Scripting 4 03-11-2005 08:05 AM
Asking on concatenate variable blueberry80 UNIX for Dummies Questions & Answers 3 07-25-2003 06:46 AM
Concatenate date to file name sierra_aar UNIX for Dummies Questions & Answers 4 02-14-2002 06:42 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-02-2002
Registered User
 

Join Date: Jan 2002
Posts: 6
Post file Concatenate

Hi All,

I have a question about file concatenate on unix. I have two file
1 of them like aaa,bbb,ccc,ddd
other one is eee,fff,ggg,hhh

I want to concatenate those file like this position
aaa,bbb,ccc,ddd,eee,fff,ggg,hhh

how can I do this ??

thanks.
Alice
Forum Sponsor
  #2  
Old 01-02-2002
shaik786
Guest
 

Posts: n/a
echo "`cat file_1`,`cat file_2`" > file_3
  #3  
Old 01-02-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,618
That solution will work if the two files contain only one line each. I know that is what Alice literally said, but she may be looking for a solution when her files contain multiple lines. So I would suggest paste:
paste -d, file1 file2 > file3
  #4  
Old 01-02-2002
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
Assuming you run ksh or bash (and sh...I think)
try...

touch ./newfile
for fn in aaa bbb ccc ddd eee fff
do
cat $fn >> ./newfile
done
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0