开发者

using sed to parse log to eliminate lines by regex

I would like to be able to clean up a log file using sed and regex

a) any line which matches /\d{13,13},\d*,[\w\s]+,.+\n/ I would like to delete 开发者_运维百科b) remove any empty lines that are remaining.

How can I do this ?


sed -re '/\d{13,13},\d*,[\w\s]+,.+$/d' -e '/^$/d' logfile
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜