[TriLUG] vi question

Scott Lambdin lopaki at gmail.com
Wed Jul 16 13:42:55 EDT 2008


This worked for me:   s/,,*/,/g

tr command would do it from the command line.


On 7/16/08, Greg Brown <gwbrown1 at gmail.com> wrote:
>
> 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
>



-- 
CILCIL



More information about the TriLUG mailing list