Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I am a novice awk programmer and this is my first and critical assignment.
I have two flat files as input.
File 1 : 1|xyz|111|perrysburg|21
2|abc|222|sylvania|21
3|pqr|121|toledo|21
4|wpr|112|annarbor|21
5|mno|131|detroit|21
6|hij|133|columbus|21
7|klm|333|cincinati|21
File 2 : 1|xyz|111|perrysburg|21
3|pqr|121|toledo|21
4|wpr|112|annarbor|21
6|hij|133|columbus|21
8|def|212|maumee|21
I would like to search on fields 1,2,4 in File1 with fields 1,2,4 from File2 and if there is a match then write the whole record of File2 to an output file1 else write the whole record of File2 to output file2.
Also,pl. remember that the file names and the column positions for the search need to be dynamic (user inputs).
Pl. help me ASAP.:-(
Thank you for your time.
I am a novice awk programmer and this is my first and critical assignment.
I have two flat files as input.
File 1 : 1|xyz|111|perrysburg|21
2|abc|222|sylvania|21
3|pqr|121|toledo|21
4|wpr|112|annarbor|21
5|mno|131|detroit|21
6|hij|133|columbus|21
7|klm|333|cincinati|21
File 2 : 1|xyz|111|perrysburg|21
3|pqr|121|toledo|21
4|wpr|112|annarbor|21
6|hij|133|columbus|21
8|def|212|maumee|21
I would like to search on fields 1,2,4 in File1 with fields 1,2,4 from File2 and if there is a match then write the whole record of File2 to an output file1 else write the whole record of File2 to output file2.
Also,pl. remember that the file names and the column positions for the search need to be dynamic (user inputs).
Pl. help me ASAP.:-(
Thank you for your time.