I am trying to remove everything up to the first comma of each line in a csv file. The lines are like:
-29.45829963684082~149.14680480957031,-000029.45829963684082, 000149.14680480957031,WGS84
-29.46190071105957~149.09509277343750,-000029.46190071105957, 000149.09509277343750,WGS84
When I execute %s/.*,\\{-}// it removes everything!
If I use %s/.*,// it removes all except WGS84 which is what I would expect.
Can anyone tell me what I'm doing wrong? I thought \{-} imposed non-greedy matching in Vim.
Thanks,
John
\{-} is the non-greedy matching in Vim, so you should use \{-} instead of *.
Try:
%s/.\{-},//
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With