Trim whitespace in a CSV
Remove whitespace from the start and end of each cell. Text in the middle of a cell stays where it is, and this page does not rename the headers.
CSV or Excel
Details
Instructions
- Drop a .csv file. Trim whitespace is already selected.
- Preview the edits. Spaces that will disappear are shown with middle dots.
- Apply when the cells look right. The row count does not change just because spaces were removed.
- Download the current table. Undo and reset are available after you apply.
Example
The first name and the second city have spaces at the edges. The header and the inner text do not.
name,city Ada ,Tokyo Bob, Lyon
Ada and Lyon lose the spaces around them. Tokyo and Bob are already clean. The header row is unchanged, and both data rows remain.
Which characters change
Only the edges of a cell are trimmed. A value with spaces around Ada becomes Ada. Ada followed by two spaces and then Lovelace keeps those middle spaces.
Tabs and line breaks at the edge are removed as well. The same trimming rule is used everywhere else in NovaToolora, so a cell that looks blank after this step is blank to the empty-row check too.
Headers are a separate step
Header names are not trimmed here. A trailing space in a column name stays until you normalize headers in the CSV cleaner.
That split is deliberate. Cleaning the cells should not rename the columns, and renaming the columns should not rewrite the cells.
Limitations
- Spaces between words stay, including a double space in the middle of a cell.
- The operation does not decide that two values are equal. 001 stays 001.
- A cell that contains only spaces becomes empty. The row is not deleted on this page.
- Other operations are available below, but only trim whitespace starts selected.
- CSV and .xlsx up to 32 MB. The download is CSV. Save .xls as .xlsx first.