in reply to How to create an accurate CSV file

Adding some <code> ... </code> tag around your code and data would make it easier to read. It would also help if you could give an example of how the CSV-file should look with your data (so we can check if any solution we suggest is correct).

Usually reading and writing CSV-files is best done with Text::CSV, but am I right in assuming that it is rather the parsing of the original data that is bothering you?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James