in reply to Parsing a csv file with multiple data records in it (generated from Window's IOMeter)

You've already got it 99% percent figured out!
when you get to a line that starts with a '#', its a list of fields. Split it on the '-' and store the results, those are your field names.
Then when you parse the lines that dont begin with a '#', also spilt them on the '-'. The data and the columns will match up by position. Then enter the results into your structure, i.e.:
$myarray[$row_number]->{$column_name} = $data;
  • Comment on Re: Parsing a csv file with multiple data records in it (generated from Window's IOMeter)
  • Download Code

Replies are listed 'Best First'.
Re^2: Parsing a csv file with multiple data records in it (generated from Window's IOMeter)
by holli (Abbot) on May 25, 2005 at 20:12 UTC
    The missing 1% is to skip empty lines, as shown in my code above.


    holli, /regexed monk/