Results 1 to 3 of 3
I have a script that I can run on my movie subtitles and fix the most common errors in subtitles. for this I have been using sed commands (the most ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-18-2012 #1
Help with sed commands
I have a script that I can run on my movie subtitles and fix the most common errors in subtitles. for this I have been using sed commands (the most common error that I have seen is using a lower case L when an upper case i should have been used). I have fixed all of these so it will clean them up real nice. One thing I am running into now is numbers. Sometimes there is a space between numbers and I would like to remove the space. This is what I tried to use:
Thinking that would get rid of the space. What it did was much worse.Code:sed 's/[0-9] [0-9]/[0-9][0-9]/g'
This is what the original looked like
and this is what the script did to it.Code:140 00:08:19,081 --> 00:08:20,999 He did my first suit when I was 1 5.
Any thoughts?Code:140 00:08:19,081 --> 00:08:20,999 He did my first suit when I was [0-9][0-9].
- 12-18-2012 #2Linux Newbie
- Join Date
- Nov 2012
- Posts
- 134
hi,
[0-9] is a range pattern.Code:sed 's/\([0-9]\) \([0-9]\)/\1\2/g
patterns are only interpreted on the left hand side of a sed command.
- 12-19-2012 #3




