Services de recherche

Outils de recherche et ouverture rapide des pages

Guide produit · 6 min de lecture

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.

Publié le 19 mars 2025 · FreeLocalConverter

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 .gitattributes for 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.

← Tous les articles