in reply to Re: How can I find and delete a line from a file?
in thread How can I find and delete a line from a file?
To delete, I think you'd need to substitute the matched line with null, but given that, I think the more obvious way is to switch to explicitly printing, like:
This one-liner also takes advantage of the -i switch to edit the file in place, which seemed to be desired in the original question.perl -i -n -e 'print if not /^sandwich,hamburger,/i' comma.file
|
|---|