Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I need it to capture the line with just the comma, or if its a blank line. Let me know if you have any questions.... Thanks, Bobheres what the file looks like: 20060819,02159,045488061,00 ,0000118,0000000,0000000,0000118,0000000,0 +000000,Zachary ,G 20060819,02159,045775830,00 ,0000649,0000028,0000000,0000649,0000028,0 +000000, , 20060819,02161,023416381,09 ,0000034,0000000,0000000,0000034,0000000,0 +000000,Erinne ,H Here's the code I have: while ($line = <OUTF>) { my @array = split(/,/ , $line); $test = @array; print "$array[5] offers and $test is number of elements\n"; if ($array[5] =~ /0000000/ || $array[5] =~ //) { # the 2nd part is + obviously wrong print "$store_number is not BCE Store\n"; } else { $store_number = $array[1]; print "Store # $store_number\n"; push(@st_n, $store_number); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array element exist
by GrandFather (Saint) on Aug 21, 2006 at 23:06 UTC | |
by Anonymous Monk on Aug 21, 2006 at 23:18 UTC | |
|
Re: Array element exist
by graff (Chancellor) on Aug 22, 2006 at 04:01 UTC |