如何使用SED删除多次出现的以下文本

问题描述 投票:-2回答:1

我想删除文本文件中出现的以下文本:

TBLPROPERTIES (text1=001 )
TBLPROPERTIES (text2=002 )
TBLPROPERTIES (text3=003 )
.....
....
..
....
......
TBLPROPERTIES (text100=100 )

我正在使用

sed '/^TBLPROPERTIES/,/^\)/{/^TBLPROPERTIES/!{/^\)/!d}}' testing_sed

并且它不起作用。

sed
1个回答
1
投票

此命令从文件中删除所有包含TBLPROPERTIES模式的行。

sed '/^TBLPROPERTIES/d' testing_sed
© www.soinside.com 2019 - 2024. All rights reserved.