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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, Need to get the contents of

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

Need to get the contents of one file behind the contents of the second one. Something like this:

File1:

1,2,3,4
6,7,8,9
a,b,c,d
words,are,possible,as

File2:

5
10
e
well

Should become:

1,2,3,4,5
6,7,8,9,10
a,b,c,d,e
words,are,possible,as,well

Thanks!

 
Try this script.
Code:
{
  a = $0
  getline < &quot;-&quot;
  print a &quot;,&quot; $0
}
Run it by entering:
Code:
awk -f script.awk file1 < file2
Hope this helps.
CaKiwi
 
Hi,

another solution is to use the paste command :

paste -d, file1 file 2
Jean Pierre.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top