Folks I need your help cuz I've a file with 100,000 records that need to be compared against a passwd file (300) and then create a third one with the data in the first one and the passwd from the second one set in it.
The format of the first file is:
host xxxxxx "" 0,0 Closed control00/ SOLARIS 0x0+0+0 "TCP"
host yyyyyy "" 0,0 Closed control01/ SOLARIS 0x0+0+0 "TCP"
...
host 222222 "" 0,0 Closed control30/ Linux 0x0+0+0 "TCP"
host 222222 "" 0,0 Closed control30/F93F0F0BC36E597B28D325BD10F99C4B Linux 0x0+0+0 "TCP"
Now you migth think piece of cake for you yes, for me no, I know that I need to read one record in the second file and the read all the records in the first one with this passwd in it and then generate the third and so on, but to be honest I don't know how to open, read & control each of them in awk or perl.
I already reviewed the archive with no luck cuz, there're only examples about comparing files.
Can you help me with this?, I'm lost and desperate.
Folks, thanks a lot for your help all the solutions works great, you saved my soul.
Now I would like to understand the awk code, can you explain to me vgersh99?, I see that you assing one field in an array and you set it later, but I don't understand the rest of the code.