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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2016-12-03 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (55 votes). Check out past polls.