I have a sed command that I've been using to format the date in datasets. I've run into an issue and I'm sure it's just my lack of understanding on the syntax but was wondering if someone could help clarify what's going on.
input:
26,082619,1300,1,2,0
26,082619,1400,332,8,190
26,082619,1500,442,10,118
26,082619,1600,530,151,12
26,082619,1700,534,164,0
26,082619,1800,538,176,0
command
sed -E "s/,(.{2})(.{2})(.{2}),/,\1\/\2\/20\3,/g" input.csv > output.csv
output (note line 3)
26,08/26/2019,1300,1,2,0
26,08/26/2019,1400,332,8,190
26,08/26/2019,1500,44/2,/2010,118
26,08/26/2019,1600,530,151,12
26,08/26/2019,1700,534,164,0
26,08/26/2019,1800,538,176,0
expected output
26,08/26/2019,1300,1,2,0
26,08/26/2019,1400,332,8,190
26,08/26/2019,1500,442,10,118
26,08/26/2019,1600,530,151,12
26,08/26/2019,1700,534,164,0
26,08/26/2019,1800,538,176,0
sed -E 's/,([0-9]{2})([0-9]{2})([0-9]{2}),/,\1\/\2\/20\3,/' input.csv