'How to remove a specific entry from a number of entries separated by comma? [closed]
I have some entries in a csv file like below
John, 20, LA, USA
Jane, 50, NY, USA
Jim, 38, PH, USA
How can I remove the second entry from all lines in vim editor so that it looks like the following?
John, LA, USA
Jane, NY, USA
Jim, PH, USA
Solution 1:[1]
This should work:
:%s/^\([^,]\+,\) [^,]\+,/\1/
Solution 2:[2]
I would do it with the following command:
:%normal! f,dt,
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | wollf |
