CSV Text Cleaner
Remove a UTF-8 BOM, normalize line endings, and clean a CSV header.
Description
CSV text preparation can remove a leading byte-order mark, normalize line endings and trim simple header cells.
CSV text preparation can remove a leading byte-order mark, normalize line endings and trim simple header cells. These are text operations before a separate CSV parser.1
Remove a UTF-8 BOM, normalize line endings, and clean a CSV header.
When to use CSV Text Cleaner
Use this tool to remove a UTF-8 BOM, normalize line endings, and clean a CSV header.
Prepare the text, recorded observations, aligned figures or editorial criteria requested. Confirm what each label, count, timestamp or supplied flag represents before interpreting the result.
How to use CSV Text Cleaner and understand its results
- Prepare the text, recorded observations, aligned figures or editorial criteria requested. Confirm what each label, count, timestamp or supplied flag represents before interpreting the result.
- Enter csvText, normalizeLineEndings, trimHeaderCells using the field table and calculation rules, then run the tool.
- Read cleanedCsvText, bomRemoved, headerCellCount, replacementCharacterCount. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| csvText | CSV text | string | Required |
| normalizeLineEndings | Normalize line endings | boolean | Required |
| trimHeaderCells | Trim header cells | boolean | Required |
Enter text and both flags. Remove one leading BOM, split on LF, optionally trim first-line comma-separated cells and rejoin with LF. Return cleaned text, header-cell count and U+FFFD replacement-character count; empty text has zero header cells.
remove leading U+FEFF; optionally CRLF/CR→LF; optionally trim comma-split header cells Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| cleanedCsvText | Cleaned CSV text | string |
| bomRemoved | UTF-8 BOM removed | boolean |
| headerCellCount | Header cell count | integer; minimum: 0 |
| replacementCharacterCount | Unicode replacement characters | integer; minimum: 0 |
{
"input": {
"csvText": " name , age\r\nAda,36",
"normalizeLineEndings": true,
"trimHeaderCells": true
},
"output": {
"cleanedCsvText": "name,age\nAda,36",
"bomRemoved": true,
"headerCellCount": 2,
"replacementCharacterCount": 0
}
} Limitations and assumptions
Header splitting does not honor quoted CSV commas. Replacement characters are counted, not repaired; CR-only input is not split into lines when normalization is disabled.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.
Alternative or Complementary methods
Use Document Entity Date Sorter: Parse compact document records, sort them by dateline, and collect unique named entities. For a complementary task, use Table Total Check: Sum supplied table rows and compare the result with a published total.
References
-
CSV Text Cleaner — tool.io
Similar or alternative tools
- Document Entity Date Sorter
Parse compact document records, sort them by dateline, and collect unique named entities.
- Table Total Check
Sum supplied table rows and compare the result with a published total.