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
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
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