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 ( [id://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

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1055299]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found