我正在处理一个 html 项目并且必须操作大量文件,所以我使用 sed、head & tail 来完成这项工作,但现在我被困在了这一点上。
要删除的字符串<i><font color="#000000"> and <font color="#000000"><i>
但不是以开头的行<b><font color="#000000"><p align="JUSTIFY"> and <p align="JUSTIFY"> and </font></b><p align="JUSTIFY">
顺便说一句,我已经写了一个,但无法弄清楚它有什么问题
sed -rei '/^<b><font color="#000000"><p align="JUSTIFY">RELATIONS.|<p align="JUSTIFY">|</font></b><p align="JUSTIFY">/! s/<font color="#0000ff"><i>|<i><font color="#0000ff">//g'
非常感谢任何帮助或建议。
问候
编辑:再次查看 html 后,我知道我们实际上想从第 8 行编辑到最后,除了所有文件的最后一行
例子
line 1 <i>some text<i>
line 2 <i>some text<i>
line 3 <i>some text<i>
line 4 <i>some text<i>
line 5 <i>some text<i>
line 6 <i>some text<i>
line 7 <i>some text<i>
line 8 <i>some text<i>
line 9 <i>some text<i>
line 10 <i>some text<i>
S <i>some text<i>
o <i>some text<i>
- <i>some text<i>
o <i>some text<i>
n <i>some text<i>
line N <i>some text<i>
至
line 1 <i>some text<i>
line 2 <i>some text<i>
line 3 <i>some text<i>
line 4 <i>some text<i>
line 5 <i>some text<i>
line 6 <i>some text<i>
line 7 <i>some text<i>
line 8 some text
line 9 some text
line 10 some text
S some text
o some text
- some text
o some text
n some text
line N <i>some text<i>