Re: delete a line of a file

2001-11-26 Thread John W. Krahn
Jorge Goncalvez wrote: > > Hi, I would like to parse a file and delete the entire line if it begins with > subnet. > How can I do this in Perl? perl -ni -e'/^subnet/ or print' yourfile.txt Or perl -pi -e's/^subnet.*//s' yourfile.txt John -- use Perl; program fulfillment -- To unsubscrib

Re: delete a line of a file

2001-11-26 Thread Elaine -HFB- Ashton
Jorge Goncalvez [[EMAIL PROTECTED]] quoth: *>Hi, I would like to parse a file and delete the entire line if it begins with *>subnet. *>How can I do this in Perl? http://history.perl.org/oneliners/filters/after_pattern.html e. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

RE: delete a line of a file

2001-11-26 Thread John Edwards
open the file, create a new file, read each line of the source file, check if it starts with subnet, if not write it to the new file. When you are done, close both files, delete the source file (if you are sure your script has made the right changes), then rename the output file to the source. So