Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Printing set characters from offset.

by mtmcc (Hermit)
on Sep 23, 2013 at 14:36 UTC ( #1055299=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Printing set characters from offset.
Download Code
Replies are listed 'Best First'.
Re^2: Printing set characters from offset.
by Jalcock501 (Sexton) on Sep 23, 2013 at 16:17 UTC
    Thanks, this worked perfectly.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055299]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (14)
As of 2015-07-07 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls