I've a problem when using SORT to resolve my file matching.
The first file is :
----+----1----+----2----+----3----+----4
001000000001 001009999999 A
013000004475 013000004479 B
013000005100 013000005100 C
022010033447 022010033447 D
030200013570 030200013579 E
040000000005 040000000005 F
050000000006 050000000006 G
001000000001 001009999999 A
013000004475 013000004479 B
013000005100 013000005100 C
022010033447 022010033447 D
030200013570 030200013579 E
040000000005 040000000005 F
050000000006 050000000006 G
The second file is :
----+----1----+----2----+----3----+----4
001000000123 HELLO
012000003350 PEN
013000005100 BOOK
022010033447 COMPUWARE
030200013573 ASUS
040000000004 FLOWER
050000000006 GOOGLE
001000000123 HELLO
012000003350 PEN
013000005100 BOOK
022010033447 COMPUWARE
030200013573 ASUS
040000000004 FLOWER
050000000006 GOOGLE
The output will be :
----+----1----+----2----+----3----+----4
001000000123 HELLO A
013000005100 BOOK C
022010033447 COMPUWARE D
030200013573 ASUS E
050000000006 GOOGLE G
001000000123 HELLO A
013000005100 BOOK C
022010033447 COMPUWARE D
030200013573 ASUS E
050000000006 GOOGLE G
I using the second file's key (column 1 to 12) to match the first file's key range(from column 1,12 to column 21,32), if the second file's key is in key range of first file, then combine the data to output.
The two files is FB and length is 40, and the key and key range are number.
Could it be done by SORT?
Thanks a lot,
Jerry