Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. lpostell

    match field in 2 files and output to a 3rd file

    to futurelet Thank you so much for your time and your solution. awk -f match-ser-num.awk file1 file2 >outfile Your solution also would work perfectly if my data was good. When I ran it, I did not get all the matches that I expected, but that was because some of the serial numbers had an...
  2. lpostell

    match field in 2 files and output to a 3rd file

    To PHV God Bless you. This solution worked perfectly: nawk 'NR==FNR{++sn[$1];next}substr($1,1,9) in sn' file1 file2 > file3 Could I trouble you to help me understand what this is doing? From my understanding: NR - the line number of the current line (but how do I know which of the 2 input...
  3. lpostell

    match field in 2 files and output to a 3rd file

    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...

Part and Inventory Search

Back
Top