How to remove the milliseconds from timestamps with sed?

前端 未结 5 1793
迷失自我
迷失自我 2021-01-27 03:48

My input file is as follows:

12/13/2011,07:14:13.724,12/13/2011 07:14:13.724,231.56.3.245,LasVegas,US

I wish to get the following:

<         


        
5条回答
  •  悲&欢浪女
    2021-01-27 04:14

    Try:

    sed 's,\(:[0-9]\{2\}\).[0-9]\{3\},\1,g'
    

    Also, try \d instead of [0-9], your version of sed may support that.

提交回复
热议问题