1753826 Members
8520 Online
108805 Solutions
New Discussion юеВ

Re: Playing with files

 
SOLVED
Go to solution
Raghu Chikkamenahalli
Frequent Advisor

Playing with files

Hello All,
I have 2 files viz. file1 and file2. I need take each line simultaneously at a time and paste it to the third file.
For ex.
file1 contains.
10
20
30
40
file2 contains,
50
60
70
80

Now I need to have file3 as follows.
10,50
20,60
30,70
40,80

Kindly help me to write a shell script which will create a third file as mentioned above.

Many Thanks,
Regards,
raghu
3 REPLIES 3
Jeff_Traigle
Honored Contributor

Re: Playing with files

man paste
--
Jeff Traigle
James R. Ferguson
Acclaimed Contributor
Solution

Re: Playing with files

Hi Raghu:

# paste -d"," file1 file2 > file 3

...is all you need.

Regards!

...JRF...
Paul Sperry
Honored Contributor

Re: Playing with files

if paste dosen't work try glue