Guia do produto · 6 min de leitura
Line endings CRLF vs LF: Git, Windows editors, and CSV parsers
Why Windows CRLF and Unix LF endings confuse diffs and parsers, how Git attributes interact, and how to normalize exports.
Publicado em 19 de março de 2025 · Table
Text files end each line with invisible characters. Windows traditionally uses CRLF (\r\n); Unix and macOS prefer LF (\n). CSV is not special: mixed endings create duplicate-looking rows in some tools and noisy Git diffs even when the data is identical.
When it matters
- Strict parsers that treat CR as part of the last column value.
- Hashing or checksum pipelines where whitespace changes the fingerprint.
- Cross-platform teams where one side re-saves CSV in Notepad and the other in vim.
Normalize deliberately
- Configure
.gitattributesfor text exports if the repo should enforce LF. - Use editor or CLI tools to convert endings before handoff, not halfway through a review chain.
After normalization, open the file in Table and confirm row counts match expectations. Search for stray \r characters if a column still looks padded on one platform only.