Hi there,
I'm trying to process a comma delimited file to remove the seconds:
916901,0,488589834,TRADE,Trade, ,2002-07-2510:14:43.387,CITI.MW,970847, , , ,808.0,2526.0,0.0,0.0,-1
So basically the .*** from the 7th field
Any help appreciated
Jon
Hi there,
I'm trying to process a comma delimited file to remove the seconds:
916901,0,488589834,TRADE,Trade, ,2002-07-2510:14:43.387,CITI.MW,970847, , , ,808.0,2526.0,0.0,0.0,-1
So basically the .*** from the 7th field
Any help appreciated
Jon
altho i am sure there is a much better way.
newdate=awk -F, '{ print $7 }' test.file|sed 's/\..*//'
so to take the long way to do it.
just awk and print each variable '{ print $1,$2,$3....$6,$newdate,$8 }'and so on.
You could use sed 's=\....==' instead of sed 's/\..*//'
That's 4 dots - the '\.' will take the first one literally - then the next three '...' will take the next 3 characters.
altho i have not tried your method. the reason i take everything after the seconds is that is it easier for the # of positions the seconds has can change. My method will take any positions after the minutes and remove them.
6 of one - half a done the other. I would be suprised if the timestamp didn't have all three positions filled....but you never do know. So fair one.