Is this the sort of thing you're looking for?
405 % cat >|junk
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
406 % perl -pe 's/([^,]*,[^,]*),/$1 /; s/ ,/,/g;' junk
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
407 %
sed can do it similarly, with just slightly
different syntax. I think you may have to escape
the parentheses with backslash and each substitution
command needs its own separate -e.
Have fun!
Regards,
- Irving
-
[EMAIL PROTECTED] Happy Man Corporation
+1 206 463 9399, ext. 101 4410 SW Pt Robinson Rd
fax: +1 209 463 9255 Vashon, WA 98070 USA
Solid Value Investment Letter -- more than 14 years
safely outperforming the stock market through wise,
conservative selection: http://www.solid-value.com/