I need to deal with a CSV file that actually contains several tables, like this:
"-------------------- Section 1 --------------------"
"Identity:","ABC123"
"Initials:","XY"
"Full Name:","Roger"
"Street Address:","Foo St"
"-------------------- Section 2 --------------------"
"Line","Date","Time","Status",
"1","30/01/2013","10:49:00 PM","ON",
"2","31/01/2013","8:04:00 AM","OFF",
"3","31/01/2013","11:54:00 PM","OFF",
"-------------------- Section 3 --------------------"
I'd like to parse the blocks in each section with something like commons-csv, but it would be helpful to handle each section individually, stopping at the double-newline as if it was the end of file. Has anyone tackled this problem already?
NOTE: Files can be arbitrarily long, and can contain any number of sections, so I'm after a single pass if possible. Each section appears to start with a titled heading (------- title ------\n\n) and end with two empty lines.