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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.