I try to parse a csv file and need to change some values for further processing.
The csv file contains a date col (column number 4), which contains values like this: 2016032100 2016032318 etc.
I want to change all date values in the csv file from 2016032102 to this: 2016-03-21 02:00:00
I tried the following:
echo "$(awk -F';' -v OFS=';' '$4=${4:0:4}-${4:4:2}-${4:6:2} ${4:8:2}:00:00"' $FILE)" > $FILE
But this of course does not work.
I also tried to put the conversion into a function, but this also does not work.
Do you have any idea?