I have a file containing duplicate timestamps, maximum two for each timestamp, actually they are not duplicate, it is just the second timestamp needs to add a millisecond timestamp. For example, I am having these in the file,
....
2011/1/4 9:14:00
2011/1/4 9:15:00
2011/1/4 9:15:01
2011/1/4 9:15:01
2011/1/4 9:15:02
2011/1/4 9:15:02
2011/1/4 9:15:03
2011/1/4 9:15:03
2011/1/4 9:15:04
....
I would like to change them into
2011/1/4 9:14:00
2011/1/4 9:15:00
2011/1/4 9:15:01
2011/1/4 9:15:01.500
2011/1/4 9:15:02
2011/1/4 9:15:02.500
2011/1/4 9:15:03
2011/1/4 9:15:03.500
2011/1/4 9:15:04
....
what is the most efficient way to perform such task?