View previous topic :: View next topic |
Author |
Message |
Dinesh Kumar Beginner
Joined: 12 Oct 2004 Posts: 13 Topics: 6
|
Posted: Mon Mar 07, 2011 9:44 am Post subject: Compare Two Files and Merge the Column Values |
|
|
The first 10 bytes represents the Key field. If there is an entry in file1 and also present in File2 on the basis of the
key field that should be captured in the output file.
The "City" column data from file2 should be concatenated and merged with the File1 data as stated below .
Note:File2 has City column as "AAAA" for "1111111111" which already exists in File2 hence that value shouldn't be concatenated again
Is this possible using a single sort step?
File1: Code: |
KeyField City
----+----1----+----2----+----3----+----4----+----5
1111111111 AAAA
1111111111 BBBB
2222222222 CCCC
3333333333 DDDD
3333333333 DDDD
|
File2:
Code: |
Keyfield City
----+----1----+----2----+----3----+----4----+----5
1111111111 XXXX
1111111111 AAAA
1111111111 EEEE
3333333333 ZZZZ
4444444444 UUUU
4444444444 VVVV
|
Output File: Code: |
Keyfield City
----+----1----+----2----+----3----+----4----+----5
1111111111 AAAA XXXX EEEE
1111111111 BBBB XXXX AAAA EEEE
3333333333 DDDD ZZZZ
3333333333 DDDD ZZZZ |
_________________ Thanks & Rgds
Dinesh |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
|
|