Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: joined records from multiple csvby Loops (Curate) |
on Jul 07, 2015 at 17:11 UTC ( [id://1133577]=note: print w/replies, xml ) | Need Help?? |
You're reading and parsing the second file for every record of the first. To speed things up, consider reading that file just once at the start. Put its contents into a hash variable based on the field you wish to join, ie. sap_id. Then as you read each record of the first file, you can very quickly access the data without going back out to the disk file.
As an aside, you might want to consider some of the CPAN modules for handling CSV files.
In Section
Seekers of Perl Wisdom
|
|