Computing.Net > Forums > Unix > Merge multiple files line by line

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Merge multiple files line by line

Reply to Message Icon

Name: Ameer
Date: April 7, 2009 at 05:09:41 Pacific
OS: Solaris
Subcategory: General
Comment:

Hello,
Need urgent help in creating a script to merge multiple files line by line, for ex:
file1:
1
2
3
4
5
file2:
1
2
3
file3:
1
2
3
4
output should be:
1,1,1
2,2,2
3,3,3
4,,4
5,,

I have 90 files to be merged to a single file. Can someone please help with a script. Need on urgent basis.



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: April 7, 2009 at 06:54:54 Pacific
Reply:

Use the paste command:

paste -d "," file1 file2 file3 > newfile


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Merge multiple files line by line

Reading a file line by line www.computing.net/answers/unix/reading-a-file-line-by-line/5633.html

print a file line-by-line www.computing.net/answers/unix/print-a-file-linebyline/4099.html

read a file line by line in unix www.computing.net/answers/unix/read-a-file-line-by-line-in-unix/7334.html