in reply to How to combine multiple files together
Next open the big CSV-file again with DBD::CSV and using an SQL statement such as "SELECT * FROM big.csv WHERE keyfield = key_value" replacing key_value by the keys in your hash, you extract the records one by one based upon the value of the keys.
As soon as you extract a record you write it to disk with Text::CSV_XS in another file.
If your csv-files are not too big, you could also try to read each record in each file with Text::CSV_XS and build a hash of arrays keyed by the value of your key-field and then empty the HoA back into a final CSV-file. This is probably faster but less intuitive.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|