Results 1 to 4 of 4
So I have this sed command that will replace " l " with " I " and fix many other l and I mistakes. I have this script running through ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-11-2013 #1
SED help with ^ first character in line.
So I have this sed command that will replace " l " with " I " and fix many other l and I mistakes. I have this script running through subtitles and it has worked great so far. The problem that I am running into is when the first letter is a lower case L and should be and upper case I.
now my sed command will not work because there is no space before the l.Code:6 00:01:28,172 --> 00:01:30,506 l vant to kiss your tush.
Is there a way I can have it change l to I if its at the beginning of a sentence?Code:sed 's/ l / I /g' $i.b > $i.a
Thanks
mac
- 01-11-2013 #2
There is a way to match word beginnings without having to put a space in front. I suggest you have a look at this tutorial which has a section on matching words as well as a lot of other useful tips.
"I'm just a little old lady; don't try to dazzle me with jargon!"
- 01-11-2013 #3
Thanks hazel, It looks like I would want to use something like
"\<l\>" "\<I\>" but how would I use that in a sed command? Or should I use a tr command?
- 01-12-2013 #4
well, you won't need the quote marks as you are already using single quotes. You do need the backslashes; they are part of the code. So \<l would mean "l at the beginning of a word". But it might not work; that tutorial was written for Solaris users and the Solaris utilities don't always work the same way as the GNU utilities that Linux uses, especially where regular expressions are concerned. As they say, your mileage may vary.
If it doesn't work, there are other ways. I would use " l|^l" to specify that l must occur either after a space or at the beginning of a line."I'm just a little old lady; don't try to dazzle me with jargon!"


Reply With Quote

