in reply to Extracting formatted text block
Those are evidently fixed-width fields, so unpack is a likely choice.
The unpack format may not be exactly right for your real data, but it matches what I think I see here (I'd expect the two records in a line to have the same format).while (<DATA>) { # seek interesting stuff . . . while (<DATA>) { last if /^\n/; my (@codes,@names); ($codes[0],$names[0],$codes[1],$names[1]) = unpack 'xx A8 x A23 xx A8 xxx A22', $_; push @interesting_stuff, grep {$_} @names; } }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extracting formatted text block
by ikegami (Patriarch) on Mar 16, 2005 at 23:33 UTC |