Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 lurking in the Monastery: (14)
As of 2014-12-18 20:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (61 votes), past polls