For the below values I have to replace the second and fourth "." by "," in the below file
input
1.351364711.103.7319660.2010-01-01 00:00:00
1.345529841.103.7372875.2010-01-01 00:00:49
1.342955629.103.7455272.2010-01-01 00:01:42
1.339694956.103.7520503.2010-01-01 00:02:28
desired intermediate output
1.351364711,103.7319660,2010-01-01 00:00:00
1.345529841,103.7372875,2010-01-01 00:00:49
1.342955629,103.7455272,2010-01-01 00:01:42
1.339694956,103.7520503,2010-01-01 00:02:28
I know awk gsub(/./,",") this replaces everything by comma.But I only need the columns to be seperated by "," . I also wanted to switch the third column in the first place after this.
desired final output
2010-01-01 00:00:00,1.351364711,103.7319660
2010-01-01 00:00:49,1.345529841,103.7372875
2010-01-01 00:01:42,1.342955629,103.7455272
2010-01-01 00:02:28,1.339694956,103.7520503
awk -F. '{print $5 " " $1 "." $2 "," $3 "." $4}'