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

Joining files 1

Status
Not open for further replies.

grega

Programmer
Feb 2, 2000
932
GB
My brain isn't working well today, so I thought I'd ask here :). I have 2 files which I wish to join together. Nothing fancy, no keys to join on. Fields are TAB separated.

File 1 (3 fields)
1 john smith
2 joe bloggs
2 mike smith
3 davy jones

File 2 (3 fields)

1 some text
2 more text
2 some text
3 more text

and I want the o/p to be (6 fields)

1 john smith 1 some text
2 joe bloggs 2 more text
2 mike smith 2 some text
3 davy jones 3 more text

Any ideas much appreciated.

Greg.

 
The simplest is to do:
Code:
join file1 file2 > joined.file
 
paste file1 file2

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Unfortunately not. I've already tried this. It gives the result

1 john smith some text
2 joe bloggs more text
2 joe bloggs some text
2 mike smith more text
2 mike smith some text
3 davy jones more text

i.e. it appears to be treating the 2st column as a join key. Can I get join to ignore keys and just doa simple join?

Greg.
 
Thank you vlad ... haven't used &quot;paste&quot; for years :)

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top