in reply to Printing set characters from offset.
substr is the easiest way.
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { my $first = substr $_, 37, 20; my $second = substr $_, 67, 3; print STDOUT "FIRST: $first\nSECOND: $second\n\n"; } __DATA__ j1000010017 6790194100109201301092013THIS TO BE PRINTED M PW09-3PY248 +005BIK00
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Printing set characters from offset.
by Jalcock501 (Sexton) on Sep 23, 2013 at 16:17 UTC |
In Section
Seekers of Perl Wisdom