[TriLUG] vi question

Joe Horvath jkhorvath at yahoo.com
Wed Jul 16 13:38:42 EDT 2008


Try this:

:1,$s/,,*/,/g

 Joe Horvath
jkhorvath at yahoo.com





----- Original Message ----
From: Greg Brown <gwbrown1 at gmail.com>
To: Triangle Linux Users Group General Discussion <trilug at trilug.org>
Sent: Wednesday, July 16, 2008 1:25:00 PM
Subject: [TriLUG] vi question

I'm trying to match multiple commas in a line in vi so I can globally change
them to a single comma (yup, I'm building a .csv file).

Here's an example line::

,101.5000,WRAL,,,,,,,,,,,,,,,,,,,,,,Raleigh,,,,,,,,,,,,,,BF,,,,,,,,,,,,,,,,,,,,,,,Rock

The leading comma is ok, I really don't care about that, it's easy enough to
strip out.

:1,$s/\,+/\,/g  is NOT working.  Grr.  Any hints?  I know I'm overlooking
something extraordinarily simple here....

Greg
-- 
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions



      


More information about the TriLUG mailing list