Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 chilling in the Monastery: (6)
As of 2015-07-29 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls