Reputation: 75
I have a text such as
/path/delivery3/afA.csv:afA;0.000;12.015;Spreker-A;;<lang:English> Yes </lang:English> Niko. <lang:English> Yes </lang:English> Niko, gaan ons verder praat oor die #um leerbesigheid? [no-speech]
using
:%s/.*;//
gives me
English> Niko, gaan ons verder praat oor die #um leerbesigheid? [no-speech]
How do I find the first :
and output
afA;0.000;12.015;Spreker-A;;<lang:English> Yes </lang:English> Niko. <lang:English> Yes </lang:English> Niko, gaan ons verder praat oor die #um leerbesigheid? [no-speech]
Upvotes: 0
Views: 889
Reputation: 195229
If you want to apply this change on a single line:
df:
If you want to apply it on all lines in a buffer you can record a simple macro using the above normal mode commands or:
:%norm! df:
If you really want to do it using the :s
command:
:%s/[^:]*://
Upvotes: 1
Reputation: 188
See "How to make regex matchers non-greedy?"
The Vim non-greedy version of *
is \{-}
So instead of :%s/.*://
, you should get the result you want with :%s/.\{-}://
Upvotes: 1