in reply to compare two files and update
Greetings!
How large are your files? Unless they are both very large it mght pay to read one (the update file) or both into hashes and/or arrays the walk through the update file and match the keys to the master file. As it is it appears you wil only read the first lien in the update file and the read the whole master file and then read the rest fo the keys. with the nested llops you wil lhave to read teh inner file on average many times (on average a number of complete passes thriugh the inner file equal to about 25% of the number of lines in the outer).
I am about to leave work but will send yo a little code when I get home.
I hope this will give you some ideas until I can send some code.
As always I am certain that if I mis-spoke a wandering monk wil correct my error. 8^)
|
|---|