开发者

using sed to parse log to eliminate lines by regex

开发者 https://www.devze.com 2023-01-25 05:07 出处:网络
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

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

精彩评论

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