At 17:36 2000.05.08 -0400, [EMAIL PROTECTED] wrote:

>I have a simple CVS file that looks like this:
>
>Name,Add,,City,State,Zip,Contact
>Joe Inc,123 Main,,Brown,NY,12345,Joe
>Pete Inc,456 7th,PO Box 1,Green,NY,12346,Pete
>Jack Inc,789 1st,Bldg 5,Red,NY,12347,Jack
>
>If you noticed, the 2nd and 3rd columns are both
>address columns. The third column varies and may
>be empty, start with a number or small/Capital letter.
>
>All I want to do is eliminate the second , (comma) and replace it
>with a space. Unfortunately I'm not strong in regular
>expressions and everything I have tried so far isn't working.

>I should have been more specific. I'm trying to
>concatenate the second and third columns. 
>Although I greatly appreciate all the quick answers, I've
>already tried all those I've seen, with the exception
>of the awk answer.
>
>It's easy to change 2 comma's to one comma. I am trying
>to eliminate the second comma on each row and replace it
>with a space, thus combining column 2 and column 3, no matter
>what is contained in column 3 - numbers, letters, or nothing

What about

  sed -e 's/^\([^,]*,[^,]*\),/\1 /'


Andr� Majorel <[EMAIL PROTECTED]>
http://www.teaser.fr/~amajorel/

Reply via email to