in reply to Stripping a seemingly complicated comma-delimited file

could you show us your actual while loop?
  • Comment on Re: Stripping a seemingly complicated comma-delimited file

Replies are listed 'Best First'.
Re: Re: Stripping a seemingly complicated comma-delimited file
by jamesSA (Initiate) on Jun 11, 2001 at 17:53 UTC
    heres the code :
    open(HIPORT,"eq010125.txt"); $file = <HIPORT>; $i = 0; while ($file =~ /\n$/) { chop $file; ($var1,$var2,$var3,$var4,$var5,$var6,$var7,$var8,$var9,$var10,$var11,$ +var12,$var13,$var14) = split(/[,]|[,]|\n$/,$file); print "$i : $var1 $var2 $var3 $var4 $var5 $var6 $var7 $var8 $var9 +$var10 $var11 $var12 $var13 $var14 \n"; $i++; }

    Edit: chipmunk 2001-06-11

      you're never actually reading from the file according to this code. try
      while ($file=<HIPORT>)
      instead of
      while ($file=~/\n$/)
      you need to wrap your code in <code> tags so it is more readable. You're also currently missing out on your brackets in your regex. This will be solved when using code tags.