Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to match column 3 in file1 to column 1 in file 2 and create file3 with column1 from file1 column2 from file1 and column2 from file 2
file 1 samplefile 2 sampleSNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS RBCN 78112T107 JT TXN 882508104 KATS STM 861012102 KATS
AT AU AU AU AV AT BB BE BS BR BSE HU BZ BR CC CL CD CZ CG CN
file1 column3 will need to match one value in file2 column1. WHen a match is found, I need to overwite file1 column3 with the corresponding match in file2 column2.
so for the above samples, the output for line1 and line2 of file3 will be:Any solutions using perl?? Thanks for your help!SNDK 80004C101 AU XLNX 983919101 BE
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching column in different files to create a third one
by kennethk (Abbot) on Jan 19, 2011 at 16:06 UTC | |
|
Re: Matching column in different files to create a third one
by jethro (Monsignor) on Jan 19, 2011 at 16:15 UTC | |
|
Re: Matching column in different files to create a third one
by toolic (Bishop) on Jan 19, 2011 at 15:51 UTC | |
by planetscape (Chancellor) on Jan 19, 2011 at 16:06 UTC | |
|
Re: Matching column in different files to create a third one
by JavaFan (Canon) on Jan 19, 2011 at 16:29 UTC |