Sounds like a job for split and a hash. What have you tried?
In reply to Re: Compare fields in a file by DStaal in thread Compare fields in a file by honyok