i have the following line:
192.168.1.200§Feb 24 10:22:14 2014 GMT§Aug 24 10:22:14 2014 GMT
and I want to convert it into this line with awk (or something else):
2014-02-24 2014-02-24 192.168.1.200
I was able to convert ONE Date with awk, using this command:
awk 'BEGIN { FS="§"} {cmd1="date \"+%Y-%m-%d\" -d \""$2"\""; cmd1 | getline var; print var}'
but I don't know how to convert the row in one command?
Here is one way with
awk
:BEGIN
statement for all months.space
and:
in to an array.Try this:
Usage: