Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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
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 chanting in the Monastery: (10)
As of 2014-07-25 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (171 votes), past polls