Any suggestions
Use a real database. Track changes to parts and stock levels in an audit table and generate reports by dumping the current period's changes from the audit table.
... without making this program any longer and hard to trace.
We can't see "this program", or even the bits relevant to the question. As described you should only need half a dozen lines of code to compare the two files. Maybe there is important stuff you forgot to describe that makes the job more interesting?
Premature optimization is the root of all job security