
Jasmine
Administrator
May 19, 2000, 4:34 AM
Post #2 of 3
(283 views)
|
It would be easier to help if you posted just a hint more information So I'm going to try to help, but will make the following assumptions: you have a pipe-delimited database; you want to delete the line that has "delete me" as the first field. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> my $line; open (DATA,"<whatever.txt") or die "Couldn't open whatever.txt $!\n"; while (<DATA> ){ chomp; my @list = split(/\|/,$_); if ($list[0] ne "delete me"){ $line .= $_ . "\n"; } } close DATA; open (WRITE,">whatever.txt") or die "Couldn't open whatever.txt $!\n"; print WRITE $line; close WRITE </pre><HR></BLOCKQUOTE> If this doesn't help, please post your existing code and let us know how you're determining which line to delete. [This message has been edited by Jasmine (edited 05-19-2000).]
|