Depending on what you are after, there is a number of ways from one-liners to
whatever.
In most basic form, you will need to open file to read, another file to write.
Using the regex or some type of test to determine if a line is to be
re-written to the file or not.
pseudo code:
open(FILEIN, "<$filein) || die "unable to open $filein: $!";
open(FILEOUT,">$fileout) || die "unable to open $fileout: $!";
while ( <FILEIN>) {
next if ( /linetodlete/ ); # if line equals this, then get next line
print FILEOUT $_;
}
close(FILEIN);
close(FILEOUT);
Wags ;)
-----Original Message-----
From: Mark Mclogan [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 07, 2001 08:34
To: [EMAIL PROTECTED]
Subject: Deleting a line
Hi everybody!
somebody know how i can delete a line of a text file?
i'm tryng some like this
/^line1/d
but i don't know the sintxs to execute some like this
and i don't know if between "/" can be a variable ($_)
Thak's all
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]