i USED THE FOLLOWING SCRIPT TO ERASE A LINE FROM A FLAT TEXT FILE . IT WORKS WELL UNDER THE CONDITONS BELOW !!! THE PROBLEM IS I AM GETTIN A NESSAGE >>>>
SERVER ERROR AFTER THE PERFORMANCE ! HOW I CAN GET RID OF THAT ? WHAT IS GOING ON?
IS THERE ANY ONE OUT THERE WHO HA SAMLL SCRIPT WHICH DOES THE SAME TASK QUIETLY?
THE SCRIPT FOLLOWS
*********************
#!/usr/bin/perl
#
# this program removes the first word in afile
#
#
$filename='she.db';
#
open AFILE, "+<$filename";
@lines = grep { ! /^she/ } <AFILE>;
seek AFILE, 0, 0; # rewind
truncate AFILE, 0;
print AFILE @lines;
close AFILE;
# I used the above script to erase line in a data base !
# the scripts erases the line >>> if the begining of the line begins with ..the string ."she"..
# the scripts read line by line . if it is the case why it did nor erase aline when "she" is in the middle.
#
# how can i get rid of a line by evaluating INSTEAD with a field name ?
SERVER ERROR AFTER THE PERFORMANCE ! HOW I CAN GET RID OF THAT ? WHAT IS GOING ON?
IS THERE ANY ONE OUT THERE WHO HA SAMLL SCRIPT WHICH DOES THE SAME TASK QUIETLY?
THE SCRIPT FOLLOWS
*********************
#!/usr/bin/perl
#
# this program removes the first word in afile
#
#
$filename='she.db';
#
open AFILE, "+<$filename";
@lines = grep { ! /^she/ } <AFILE>;
seek AFILE, 0, 0; # rewind
truncate AFILE, 0;
print AFILE @lines;
close AFILE;
# I used the above script to erase line in a data base !
# the scripts erases the line >>> if the begining of the line begins with ..the string ."she"..
# the scripts read line by line . if it is the case why it did nor erase aline when "she" is in the middle.
#
# how can i get rid of a line by evaluating INSTEAD with a field name ?