in reply to Parsing a long string
$s = '1START ACCOUNTA XXXXXMA 12345 XYZ111 1ST +ART ...';; print $1 while $s =~ m[((?:\S+\s+){5})]g;; 1START ACCOUNTA XXXXXMA 12345 XYZ111 1START ACCOUNTB XXXXXBR 12345 XYZ191 1START ACCOUNTA XXXXXNY 54321 XYZ131
Or as the records appear to be fixed length:
[0] Perl> print $1 while $s =~ m[(.{61})]g;; 1START ACCOUNTA XXXXXMA 12345 XYZ111 1START ACCOUNTB XXXXXBR 12345 XYZ191 1START ACCOUNTA XXXXXNY 54321 XYZ131
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing a long string
by Anonymous Monk on Aug 16, 2013 at 19:16 UTC | |
by AnomalousMonk (Archbishop) on Aug 16, 2013 at 20:08 UTC | |
by BrowserUk (Patriarch) on Aug 16, 2013 at 20:05 UTC |