How to delete from all .asc files in the directory the lines containing '=' and 'HISTORY' (which is always capitalized) and all empty lines?
I think it will be something like:
for file in /media/linux/DATADISK/*.asc
do
sed '/=/d'
sed '/HISTORY/d'
done
Best Answer
do all in one go.
Replace
^$
with^[[:blank:]]*$
in addition to remove lines those containing only Tabs/Spaces too or use^[[:blank:]]*\r?$
if your file's line-feed could be Windows-Style\r\n
.to update changes inplace, add
-i
option, seeman sed
for details.