Page is a not externally linkable
- Hardware and OS Related Technologies
-- Linux, Unix, and *nix like Operating Systems
---- SED replace double spaces


wesg - 5:51 am on Sep 12, 2010 (gmt 0)


I have a .CSV file I need to clean up with bash. The csv file was built using OCR so the table row is all shown as 1 cell separated by xx spaces. I want to replace up to xx spaces with a single comma to start a cell.

I've tried using
sed "s/[\s]{2,}//g"

but that doesn't seem to do the job. I replaced \s with just a " " character but that didn't fly either.

Suggestions?


Thread source:: http://www.webmasterworld.com/linux/4200711.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com