I have a log with following date format:2013-12-14 18:53:33 aaaaaaaaaaaaaaaa2013-12-14 18:53:33 bbbbbbbbb2013-12-14 18:53:33 cccccccccccccccccccccWhat would be the simplest solution to convert it to Dec 14 18:53:33 aaaaaaaaaaaaaaaaDec 14 18:53:33 bbbbbbbbbDec 14 18:53:33 cccccccccccccccccccccpreferably in bash (or python)
convert date format in log
bash;date
You could do something like:awk -F- 'BEGIN{split(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,m,,)}         {print m[$2], substr($0,9)}'Or:awk -F- '{print substr(JanFebMarAprMayJunJulAugSepOctNovDec, \         $2*3-2,3), substr($0,9)}'Or:sed 's/$/:01Jan02Feb03Mar04Apr05May06Jun07Jul08Aug09Sep10Oct11Nov12Dec/     s/.....\(..\).\(.*\):.*\1\(...\).*/\3 \2/'