in reply to Split on whitespace or other criteria
That doesn't look like a split file ... it looks like a substr file. And, of course, the best way to get fields from a fixed-width line is ... unpack.
Of course, such a small sample of your data doesn't lend itself to perfect analysis, so the regexp's may be more suiting.while(<DATA>) { my @fields = unpack "A7A6A*", $_; print join(':', map { sprintf "%.2f", $_ } @fields), "\n"; } __DATA__ 123.45 345.3 234.67 34.56 234.1 123.87 897.34 567.32-100.90
|
|---|