Reputation: 162
I am trying to delete all of the text between two strings in a number of txt files, including the strings themselves.
The strings are SUBJECT:
and BODY:
This is what I have been using:
sed '/SUBJECT:/,/BODY:/d' *.txt
It appears to run without issue, but there are no changes to the files upon completion.
Upvotes: 0
Views: 1451
Reputation: 3486
Add the -i
flag to modify the files in place:
sed -i '/SUBJECT:/,/BODY:/d' *.txt
Upvotes: 3