rblog

Remove lines from file

While reviewing a SystemOut.log-file created by WebSphere I needed to remove all lines containing “SystemOut”. Luckily I have installed Cygwin, so Perl to the rescue. Found this Q&A at StackOverflow.

Ended up with

perl -ni.bak -e 'print unless m!^.*SystemOut.*!' SystemOut.log

Original file > 80.000 lines, resultfile 195 lines…a bit easier to read…