Artificial intelligent assistant

From gpx to csv file <wpt lat="1.345529841" lon="103.7577152"><time>2010-01-01T00:00:00Z</time</wpt> <wpt lat="1.345529841" lon="103.7577152"><time>2010-01-01T00:00:00Z</time></wpt> <wpt lat="1.3982529841" lon="103.90877152"><time>2010-01-01T00:00:00Z</time></wpt> I have a file like having the above lines which needed to be converted into 1.345529841,103.7577152,2010-01-01 00:00:00 1.345529841,103.7577152,2010-01-01 00:00:00 1.3982529841,103.90877152,2010-01-01 00:00:00

You could use `sed` to strip out the characters you don't want:


sed 's/[^0-9.T:-]\+/,/g;s/T/ /;s/^,\|,$//g' file


`s/[^0-9.T:-]\+/,/g` is replacing unwanted characters with a comma

`s/T/ /` is replacing the character `T` with a space

`s/^,\|,$//g` is removing the first and last comma

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6980af53c0aa74869feb850ec723717a