I am trying to write a compact AWK script to read a file that contains a list of id's like this:
444
234
236
I have a second file that is pipe delimited where the 6th record is this id like this:
name|address1|address2|hphone|wphone|444|
I want to print out to the screen any record in the second file whose id is in the first file. It's essentially automating (and hopefully streamlining) the process similar to: grep 444 file2 and then making sure its only 444 and its in the 6th field.
Is there a simple AWK Script that do this? Please keep in mind that my second file, the file to be searched has 8 million records, so greps are slow.
Thanks,
Robert
444
234
236
I have a second file that is pipe delimited where the 6th record is this id like this:
name|address1|address2|hphone|wphone|444|
I want to print out to the screen any record in the second file whose id is in the first file. It's essentially automating (and hopefully streamlining) the process similar to: grep 444 file2 and then making sure its only 444 and its in the 6th field.
Is there a simple AWK Script that do this? Please keep in mind that my second file, the file to be searched has 8 million records, so greps are slow.
Thanks,
Robert