I'm trying to create a shell script that performs a nawk command to do the following:
I have 2 files. file one contains only serial numbers. File 2 contains serial number plus detailed information. I need to read the serial number file and find matches on the first 9 characters in file 2. If a match is found then I need to print the detail record to a 3rd file.
File 1 - serial number file
ZZZ222222
TTT888888
FFF333333
AAA777777
File 2 - detail file
CCC444444xxx888 xx3
AAA777777zzz999 ii4
OOO333333iii000 nn9
TTT888888vvv777 ee8
SSS999999hhh444 xx9
Output file 3 should look like this:
TTT888888vvv777 ee8
AAA777777zzz999 ii4
thank you for any help provided,
Lorraine
I have 2 files. file one contains only serial numbers. File 2 contains serial number plus detailed information. I need to read the serial number file and find matches on the first 9 characters in file 2. If a match is found then I need to print the detail record to a 3rd file.
File 1 - serial number file
ZZZ222222
TTT888888
FFF333333
AAA777777
File 2 - detail file
CCC444444xxx888 xx3
AAA777777zzz999 ii4
OOO333333iii000 nn9
TTT888888vvv777 ee8
SSS999999hhh444 xx9
Output file 3 should look like this:
TTT888888vvv777 ee8
AAA777777zzz999 ii4
thank you for any help provided,
Lorraine