in reply to reformat log files
I used the following data for testing:perl -i~ -pe ' s/(.*) ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}) +$/$2 $1/;' 2001-01-02.log
BTW, this is a shorter version of the regex: s/(.*) ((?:[0-9]{1,3}\.){3}[0-9]{1,3})$/$2 $1/234.234.234.234.asd.f2.35.346t.sdfg.aws.5332.6t.sdf.as4.23.4234 12.12. +153.43
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reformat log files
by Anonymous Monk on Aug 31, 2012 at 13:03 UTC |