![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
echo "`cat file_1`,`cat file_2`" > file_3
|
|
#3
|
||||
|
||||
|
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
|
||||
|
||||
|
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 |