Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Regex problem

by Samy_rio (Vicar)
on May 10, 2007 at 08:52 UTC ( #614573=note: print w/ replies, xml ) Need Help??


in reply to Regex problem

Hi, try like this,

use strict; use warnings; while (<DATA>){ if ($_ =~ m/^00CH,Gateshead MCD,([^\n]+)/){ my @pos = split/\,/, $1; print "Position : $_ \t $pos[$_]\n" for (0..$#pos); } print '-' x 90, "\n"; } __DATA__ 00CH,Gateshead MCD,619,172.90,158.94,186.87,,537,87.42,79.61,95.23,,11 +56,126.89,119.29,134.50 00CH,Gateshead MCD,69,12.90,158.94,186.87,,537,87.4,7.61,95.23,,116,12 +6.89,19.29,14.50

Regards,
Velusamy R.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';


Comment on Re: Regex problem
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-08-31 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls