Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How to skip first n character from data and read every m character..

by thezip (Vicar)
on Aug 15, 2008 at 16:08 UTC ( #704571=note: print w/ replies, xml ) Need Help??


in reply to How to skip first n character from data and read every m character..

Here's yet another way to do it:

#!/perl/bin/perl use strict; use warnings; use Data::Dumper; my $str = '123456789100020003000400050006000'; my $pattern = 'A9(A4)*'; my @values = unpack($pattern, $str); print Dumper(\@values);

Just change the values in the $pattern to suit your needs.


Your wish is my commandline.


Comment on Re: How to skip first n character from data and read every m character..
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-07-30 00:45 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 (269 votes), past polls