I am a super novice Perl programmer.
I have 2 delimited files. File 1 is pipe delimited and contains names with social security numbers. File 2 is comma delimited and contains names, socials and a unique identifier that is alphanumeric. There is a max of 1 row of data for each person in file 2. There could be none. The is 1 or more rows of data for each person in file 1. Could be 1 or there may be 30. And the rows are typically interspersed throughout the file (not together). What I need to do is grab the SSN from file 1, find that SSN in file 2, grab the corresponding unique identifier from file 2 and plug it into a field in the record in file 1. I have a Perl script that is working but it is very, very slow. I am splitting the file 1 lines into an array, doing the lookups and replaces and then writing the line to a file. I repeat this until I process all the records in file 1.
Sorry to be so long winded. Any suggestions on how to improve (speed up) would be greatly appreciated.
I would be happy to post my code but it is probably too long for this small box.
In reply to Best way to search file by insta.gator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |