in reply to Call for code samples!
I was trying to parse a fixed delimited report. But the locations of the columns was not fixed. However there was a header, something like this:
To locate the positioning of the columns I found the line with the underlines and then:Here Be Many Columns -------- ---------- ---------
You can also put together a small "parse engine" as a demo of \G matching. Handling the CSV spec might be a good example.my @space_loc; while ($line =~ / /g) { push @space_loc, pos($line); }
|
|---|