.csv

Search services

Search tools and open pages quickly

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

← Todos os artigos

Usado e confiado por equipas líderes

Logótipos num carrossel (cada um abre o site da marca num novo separador): Google, Apple, Meta, GitHub, Stripe, Shopify, Databricks, Snowflake, Notion, Vercel, Intel, NVIDIA, Netflix, Spotify, Airbnb, Yale, Harvard University, Massachusetts Institute of Technology, Stanford University, University of California, Berkeley, Princeton University, California Institute of Technology, Columbia University, University of Chicago, Cornell University, Duke University, Carnegie Mellon University, Georgia Institute of Technology, Johns Hopkins University, Northwestern University, University of Toronto, McGill University, University of Oxford, University of Cambridge, Imperial College London, University College London, ETH Zurich, EPFL, Technical University of Munich, Sorbonne University, KU Leuven, National University of Singapore, Nanyang Technological University, Tsinghua University, Peking University, The University of Tokyo, KAIST, Seoul National University, University of Melbourne, Australian National University, University of Sydney, The University of Hong Kong.