Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 monastery is silent...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2017-07-23 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (347 votes). Check out past polls.