Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-08-28 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls