Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl (http://www.velocityreviews.com/forums/f17-perl.html)
-   -   only 10 lines at a time (http://www.velocityreviews.com/forums/t24763-only-10-lines-at-a-time.html)

Todd Anderson 01-20-2004 07:48 PM

only 10 lines at a time
 
Hello,
I have a script that needs to open a fat file > determine which lines
represent lines say 251-260 (@billingnumber) and ($yes_row)> and which
lines represent the ignored lines ($hold_row) > then do a bunch of stuff
to the lines i want ($yes_row).
The code below isn't finding the yes_lines. (probably if($billingnumber
ne "$e_number"){ is wrong.)
Any help is appreciated.
Thanks in advance for your help.

open (USERS, "$file") || &billerror
("$file Billing Notice" );
flock(USERS, 2);
while (<USERS>)
{
$line = $_;
chomp $line;
@line = $line;
@fields = split (/\|/, $line);
$billingnumber = @billingnumber;
foreach $line (@line){
$e_number++;
if($billingnumber ne "$e_number"){ # Save all the ignored lines
$hold_row .="$line\n"; }
else{ $yes_row .="$line\n"; #find the lines i want
@yes_row = $yes_row;
}#else
}#e_number

foreach $line2 (@yes_row){
chomp $line2;
@fields = split (/\|/, $line2);
#do a bunch of stuff to yes lines
}# foreach line2
}#while
flock(USERS, 8);
close (USERS);


Gunnar Hjalmarsson 01-20-2004 08:21 PM

Re: only 10 lines at a time
 
Todd Anderson wrote:
> I have a script that needs to open a fat file > determine which
> lines represent lines say 251-260 (@billingnumber) and ($yes_row)>
> and which lines represent the ignored lines ($hold_row) > then do a
> bunch of stuff to the lines i want ($yes_row).
> The code below isn't finding the yes_lines. (probably
> if($billingnumber ne "$e_number"){ is wrong.)


That code makes no sense to me. It's badly written, and accordingly
difficult to debug. Ask the author for help.

Also, please note that this group is defunct, and replaced several
years ago with comp.lang.perl.misc. You'd better not ask questions here.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



All times are GMT. The time now is 04:37 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.