要只打印這是從開始直至到終點打印僅僅是從開始直至到終點
例子:
Started at Mon Nov 25 14:30:02 ALMT 2013
Load average for db1 is 10 which is less than 100
Load average for db2 is 3 which is less than 100
Load average for db3 is 6 which is less than 100
Load average for db4 is 5 which is less than 100
Load average for db5 is 5 which is less than 100
Mon Nov 25 page
some other data
some other data
some other data
預計:
Started at Mon Nov 25 14:30:02 ALMT 2013
Load average for db1 is 10 which is less than 100
Load average for db2 is 3 which is less than 100
Load average for db3 is 6 which is less than 100
Load average for db4 is 5 which is less than 100
Load average for db5 is 5 which is less than 100
Mon Nov 25 page
我試試那個:
perl -0777 -lpe 's|Started .*? page||xsg' 1
但是刪除了我想打印的整個區域。
犯錯我沒有看到任何終點。 – fedorqui
只是滾動到有正確的「開始在...」和完成是「25頁」 –
所以你記錄的「結束」是「開始」行日期,後跟字符串「頁」?在「頁面」之前有大量的空白?你必須具體,因爲我們無法讀懂你的想法:你必須告訴我們你需要什麼。 – TLP