$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
In reply to Re: Parsing a long string
by BrowserUk
in thread Parsing a long string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |