Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to remove a specific entry from a number of entries separated by comma?

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This should work:

:%s/^\([^,]\+,\) [^,]\+,/\1/
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading