only 10 lines at a time

T

Todd Anderson

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);
 
G

Gunnar Hjalmarsson

Todd said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top