How to merge two columns of numbers from two different files?

How to merge two columns of numbers from two different files?

Post by C.M. Leu » Tue, 19 Oct 1993 02:13:21



Hi there:

        I have two data files which have more than a few columns of numbers.
I want to pick certain column from each file and merge them together into a
third file.  How to do this?  Too bad awk only takes one input file

Regards

 
 
 

How to merge two columns of numbers from two different files?

Post by Mike Ka » Tue, 19 Oct 1993 08:33:16


|> Hi there:
|>
|>   I have two data files which have more than a few columns of numbers.
|> I want to pick certain column from each file and merge them together into a
|> third file.  How to do this?  Too bad awk only takes one input file
|>
See the man page for paste.

--
+---------------------------------------------------------------+
| Mike D. Kail                      AT&T:   (612) 945-6527      |
| Advanced Technology, IS&T         FAX:    (612) 945-6502      |

+---------------------------------------------------------------+
| "Nothing great was ever achieved without enthusiasm."         |
|  - Ralph Waldo Emerson                                        |
+---------------------------------------------------------------+

 
 
 

1. how to join two files using two columns as key

Hi

I have two tab-delimited flat files. Both have column x coordinate and y
coordinate. I want to join them by using their coordinate as the key
(which should include both x and y coordinate). Is there way to do this
using shell commands sort and join, etc? Thanks a lot! (only those
coordinates in file1 will be appeared in final merged results). -Yong

File 1:
x y number1
1 2   343.5
1 3   444.2
0 1   33.4

File 2:

x y number2
0 1 333
1 2 444
1 3 555
0 8 666

Merge results:
x y number1 number2
1 2 343.5    444
1 3 444.2    555
0 1 33.4     333

2. ANNOUNCE: Beagle SQL Free Client Server DBMS for UNIX

3. Sorting By Second Column With Unique First Column

4. scanner problem

5. why ifconfig shows two identical MAC address for two different NIC

6. NATD gags on UDP packets in 3.4-STABLE

7. allowing two kernels and two different module sets

8. Network Configuration Question

9. How to trigger two programs on two different machines at the same time?

10. How can I mirror two hard drives in two different machines?

11. Two different XF86Config for two diff Xservers?

12. Retuning the number of seconds between two dates

13. Two different IP numbers in the same machine