You can read clist and ilist at the same time, thus not reading clist more than once. You should sort both files by the compared fields.
There's a thread that covers this issue called "Merging files in a single one", dated May 25th. You can follow that for help!
Also, if you have access to MySQL, you can import both files into two tables and let sql do work for you. I suppose this is slower, anyway.
Hope this helps you
Regards
Iņaki