Sample Header Ad - 728x90

Removing white space using sed but skipping Date-Time stamp

0 votes
4 answers
1098 views
I wanted to remove white space from a CSV file, which I am able to do using s/\ //g, but at the same time I want to avoid removing the space between fields which has timestamps e.g. "06-JAN-15 13:20:00": currently it joins them which was expected "06-JAN-1513:20:00". One solution is to let it delete all the white spaces and then grep for date 06-JAN-15 and add space after it. Not so sure how that can be done. Sample CSV file: (one line only) 294335,"17-APR-15 00:00:00 ",6258,"C"," ,"07-JAN-15 00:00:00" huge blank space will contain XML message if not blank.
Asked by JavaQuest (207 rep)
Jun 30, 2015, 07:03 PM
Last activity: Aug 17, 2023, 02:13 PM