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.
In reply to Re: Flat File Question
by hmerrill
in thread Flat File Question
by lisaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |