Question about sed command.
Hi,
I've this 2 line in a file: Code:
00:02:2 Code:
00:02:02 How do I do that with sed command? |
This will replace :2 with :02 in the first line of the file.
Code:
sed -i '1 s/:2/:02/' file.name |
But it could be any number from [1-9].
For example: [code] 00:01:1 00:02:2 00:03:5 00:04:9 00:02:34 00:05:49 00:10:24 [\code] |
Same solution but save the data:
Code:
sed -ri 's/:([1-9])$/:0\1/' file |
All times are GMT -5. The time now is 10:42 AM. |