a.txt 內容如下
[03:23]
[00:01.66]
我想將 [03:23]
變為 [03:23.00]
但不動到 [00:01.66]
請問該如何寫呢?
thanks
--
update: 我找到答案了
$ echo "[03:23][00:01.66][04:56]" | sed -e 's/\(:[0-9][0-9]\)\(\]\)/\1.00\2/g'
[03:23.00][00:01.66][04:56.00]
參見
1. https://stackoverflow.com/questions/58421448/sed-insert-a-word-string-between-two-patterns-in-the-same-line
2. https://superuser.com/questions/1000409/insert-a-string-between-two-patterns?newreg=4d67d829282949c2ae4f46b4706c93c6




























































































