My input file layout is: mm/dd/yyyy,hh:mm,other fieldsI need to format it as:  yyyy-mm-dd hh:mm:00,other fieldssample input:  01/02/1998,09:30,0.4571,0.4613,0.4529,0.4592,604217501/02/1998,09:45,0.4592,0.4613,0.4529,0.4571,995602301/02/1998,10:00,0.4571,0.4613,0.455,0.4613,893955501/02/1998,10:15,0.4613,0.4697,0.4571,0.4697,1282362701/02/1998,10:30,0.4676,0.4969,0.4613,0.4906,28145145sample output:  1998-01-02 09:30:00,0.4571,0.4613,0.4529,0.4592,6042175etc...I tried to use:sed -r 's/\(^[0-9][0-9])\(\/[0-9][0-9]\/)\(\/[0-9][0-9][0-9][0-9],)/\3\1\2/gCan someone help?
sed command to swap characters
text processing;sed;awk;regular expression;perl
sed -e 's/\(..\)\/\(..\)\/\(....\),\(.....\),\(.*\)/\3-\1-\2 \4:00,\5/'Edited to include the input from the comments below:sed -e 's#\(..\).\(..\).\(....\),\(.....\),#\3-\1-\2 \4:00,#'