- 論壇徽章:
- 0
|
a
b
c
d
e
...
==========訪問總數(shù)========:1
...
==========訪問總數(shù)========:1437
==========訪問總數(shù)========:1438
==========訪問總數(shù)========:1439
==========訪問總數(shù)========:1440
==========訪問總數(shù)========:1441
==========訪問總數(shù)========:1442
==========訪問總數(shù)========:1443
==========訪問總數(shù)========:1444
==========訪問總數(shù)========:1445
==========訪問總數(shù)========:1446
==========訪問總數(shù)========:1447
==========訪問總數(shù)========:1448
==========訪問總數(shù)========:1449
==========訪問總數(shù)========:1450
==========訪問總數(shù)========:1451
==========訪問總數(shù)========:1452
==========訪問總數(shù)========:1453
==========訪問總數(shù)========:1454
==========訪問總數(shù)========:1455
==========訪問總數(shù)========:1456
...
==========訪問總數(shù)========:66666
...
==========訪問總數(shù)========:n
...
g
n
d
如上所示,我要刪除匹配==========訪問總數(shù)======== 的行,保留最后一行,==========訪問總數(shù)========:n,n這個數(shù)值當(dāng)然可以從文本中找到,是一個固定的值,但是因為可能有1000萬行,太大了,不想去文件中找,請問有什么辦法能處理嗎?
sed -i '/^==========訪問總數(shù)========:/,100d' file
嘗試了以上寫法,發(fā)現(xiàn)匹配==========訪問總數(shù)========的行全部刪除掉了 |
|