Datatune

Remove extra spaces from CSV and Excel columns

A space you cannot see is still part of the value. Upload the file, pick the columns to trim, and download a copy where the stray whitespace is gone.

Trim a file

What stray whitespace actually breaks

Trailing spaces are the most common reason a spreadsheet behaves in a way that looks impossible. The value on screen reads correctly, so the fault is hard to see and easy to blame on the tool instead of the data.

What trimming does

Leading and trailing spaces only

Whitespace before the first character and after the last one is removed from the columns you select. Spaces between words are left alone, so full names, street addresses and product descriptions keep their meaning.

Applied per column

You choose which columns to trim rather than trimming the whole table. Useful when only the imported columns are dirty and the rest of the file is already known to be clean.

Trim before you deduplicate

Order matters. Trimming first and cleaning blanks afterwards is the sequence that catches the most problems, because a cell holding nothing but spaces only becomes recognisably empty once it has been trimmed. Steps run in the order you arrange them, so both can be applied in a single pass over the file.

Questions

Why do two identical looking values not match?

Because one of them carries a space that is not visible on screen. A lookup, a join and a duplicate check all compare the stored text exactly, so a trailing space makes two otherwise identical values count as different.

Does trimming remove spaces inside a value?

No. Only the spaces before the first character and after the last one are removed, so a value such as a full name or a street address keeps the single spaces that separate its words.

Can trimming be combined with other cleaning steps?

Yes. Steps run in the order you arrange them, so trimming first and then filling or dropping blanks is a common sequence, because trimming can turn a value that was only spaces into an empty one.

Related