[ILUGC] Re: How to convert 20:40.280 (mm.ss.SSS) to 00:20:40.280 (hh.mm.ss.SSS) in Bash

  • From: Gopinath M <mgopi1990@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx
  • Date: Sat, 5 Sep 2020 14:04:58 +0530

Let's believe that the min field will be consistantly below 60. If not for
conversion.. we might need to use awk.
sed 's|[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]|00:&|g' file > a.out


On Thu, Sep 3, 2020, 6:06 AM Baskar Selvaraj <baskar@xxxxxxxxxxxx> wrote:

Hi all,
How to convert 20:40.280 (mm.ss.SSS) to 00:20:40.280 (hh.mm.ss.SSS) in Bash

sed/awk/gawk/perl based solution would be appreciated.

Thanks in advance.

S. Baskar


---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on irc.freenode.net




---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on irc.freenode.net

Other related posts: