in reply to Flat File Question
If the files are too big, the last resort might be to have an outer loop to loop through the file 1 records, and an inner loop that for each file 1 record, will loop through all the records in file 2, looking for a company name match.1. if the two files are relatively small, you can read them both into hashes, where the key is the company name (assuming the company name is what you want to match on) and the value is the whole pipe delimited record. Loop through the 1st hash, like you did in the "for" above, and for each hash element, check for a matching company name in the other hash. This would be the fastest (performance) approach. 2. loop through the records in file 2 - create a hash where the key is the company name, and the value is the whole pipe delimited record. After that loop is done and the hash for file 2 has been created, loop through file 1 records - for each record, see if there is a matching company name in the file 2 hash.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Flat File Question
by lisaw (Beadle) on Oct 24, 2003 at 23:48 UTC | |
by hmerrill (Friar) on Oct 27, 2003 at 14:45 UTC | |
by hmerrill (Friar) on Oct 27, 2003 at 17:24 UTC |