in reply to Search & Replace Across Two Files

Well, for one thing, both files are being opened for "read only" access ("<"). "+<" will allow both read and write.

You might consider reading the first file's code - room pairs into a hash (presuming that each numeric code is unique) and open the second file substituting the hash key for the hash value "looked up" in the first file.

<><

generator

Replies are listed 'Best First'.
Re^2: Search & Replace Across Two Files
by tod222 (Pilgrim) on Nov 21, 2010 at 23:28 UTC
    "+<" will allow both read and write.

    In most cases like this one modifiying an input file is a really bad idea.