Splitting a CSV line on ',' is optimistic, if you haven't dealt with any '"' sections... Wiping out all '"' is a bit brutal if you haven't dealt with '""' pairs... Unless you know that the data never contains either of these in '"' sections.
People refer to CSV files as if there was some well defined standard. Using one of the CSV parsers will at least give you access to others' experience of the different ways in which CSV has been interpretted.
But addressing your posting, I'm with brother ikegami on this: most likely there's a "096 " field. If so, should you be stripping spaces that were, notionally, "protected" by the '"'s ? I note also that while you strip trailing whitespace from items, you don't strip leading whitespace -- I cannot tell if that's deliberate :-)
In reply to Re: Baffled by data cleaning regex issue
by gone2015
in thread Baffled by data cleaning regex issue
by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |