Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Parsing CSV only returns the second line of the file

by Anonymous Monk
on Sep 01, 2012 at 06:48 UTC ( #991123=note: print w/ replies, xml ) Need Help??


in reply to Parsing CSV only returns the second line of the file

Anyone knows where I'm doing something wrong?

One loop inside another, without adequate understanding of files and modulus operator

$ perl -le " for(1..20){printf qq{%s %s\n}, $_, int($_ % 1 ); } " 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0


Comment on Re: Parsing CSV only returns the second line of the file
Download Code
Re^2: Parsing CSV only returns the second line of the file
by saint_geser (Initiate) on Sep 01, 2012 at 07:00 UTC

    Could you please elaborate on that. I don't know much about perl, you're right but it is really annoying to do all these files by hand.

      Could you please elaborate on that.

      Find places in your code, say, a loop inside a loop, where you use the modulus operator, say like "% 1"

      Then compare that line to my code, esp the output

      When do you think that inner loop will end?

      Here is a better one, what do you think the inner while loop does, what is its purpose?

      Here is another hint, how many times do you get this warning (after you add the code)?  if( warn "calling parse " and $csv->parse($_) ) {

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-08-23 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls