I want to compare these 2 files. If there is anybody in file 2 that has the 3rd field match up with the field in file 1, I want to make a new file with their information.
In this example, I would have a new file (file 3) that would contain:
Jones/Ron ,P,2222
Carter/Jane ,P,4444
I want to be able to do this in the command file format:
example awk -f (name of my awk command file) File 1 > File 3
Please forgive me for asking so many questions. I am just learning awk and I have a longgggg way to go.
Ok, so I put your script into an awk file called AWK1. I want to run it like this:
awk -f AWK1 file 2 > file 3
I want the output to go to file 3. I need file 2 to reference file 1. This would be done in your awk script. I don't see the file references in your awk script.
I put examples of file 1 and file 2 in my original post.
It is simple and does what I need it to do. I do know what it does. I have comment lines (which I did not include) in the file so I never forget what it does.
Note: we do not have the nawk command on our Unix box. I had to use awk.
Ah, a happy and a well-documented customer - the best kind!
BTW, 'nawk' stands for 'NewAWK' - most likely you can run the posted 'nawk' snippet through your own 'awk'.