in reply to compare two files and update

My apologies for not getting back last night, RealLife unfortunately intervened. It would help to have more information on the file you are updating. Things like is the file in order, is necessary to maintain the original order etc. The requirements determine what approaches are appropriate. It has been my experience that time spent up front considering the requirements and the data will save a lot of grief down the road.

Without more information the code from umasuresh should work and give you a good starting point

Good Luck!

Misha/Michael - Russian student, grognard, bemused observer of humanity and self professed programmer with delusions of relevance