XLSX to TSV — the separator contract, and the cells that break it
Tabs are used instead of commas for one reason: the content already contains commas. That reason also explains why tab output is not simply join with a tab. A field that contains a tab, a quote or a newline still has to be marked, or the reader will split it into two columns.
Cell formatting, colours, column widths and merged ranges are dropped; only stored values survive.
Processed on your device. Files aren’t sent anywhere.
Why tabs still need quotes
A delimiter format has two jobs: separate fields, and mark fields that contain the separator. Both jobs survive when the separator changes from comma to tab.
The converter quotes a field when it contains the tab character, a double quote, or a newline. Inside a quoted field, a literal double quote is written as two double quotes.
- A cell with a comma needs no quoting in tab output — the comma is not the separator.
- A cell with a tab needs quoting, and that is the case most often missed.
- A cell with a newline needs quoting; the reader keeps the line break inside the field.
- Quoting is applied by the writer, not by the spreadsheet.
A cell that contains the separator
Consider a plate map where sample names read like Sample A, 24h. In tab output the comma is harmless, so the name travels as one field. A cell that holds a tab inside it is the one that needs quoting, and if it were written unquoted the tool would read two columns where the sheet had one.
| Cell content | Written as | Reader sees |
|---|---|---|
| Sample A, 24h | Sample A, 24h | one column |
| Sample then a tab then A | quoted field | one column |
| He said "ok" | "He said ""ok""" | one column |
| two lines in one cell | quoted field | one column |
A tab inside a cell has nowhere to go
Quoting protects the field, but the tab itself is still in the text. A pipeline that splits on tabs before checking quotes will still see an extra column. If your tool does naive splitting, replace tabs inside cells with a space before converting.
Questions
Does tab output quote fields at all?
Will my tool mis-split if a cell contains a tab?
Are dates converted to ISO format?
Numbers, dates and blanks on the way out
Numbers leave as the characters stored in the cell. Dates leave as the text shown on screen, because a delimited file has no date type and guessing a calendar value could shift dates by days depending on workbook settings.
Trailing blank cells at the end of a row are trimmed, so a row that ends with empty cells is written shorter than a full-width row. That is normal and matches how delimited files are usually written.
- Numbers: characters, not spreadsheet formatting.
- Dates: displayed text, no date type.
- Trailing blanks: trimmed from the end of each row.
- Empty cells inside a row: kept as empty fields, so the column count stays aligned.
Checking the column count
The failure this route produces is a column count that drifts. Check it before the pipeline reads the file.
- Convert and download the TSV.
- Split each line on tabs in a text editor or a small script.
- Compare the field count of every line with the header.
- Look for lines with more fields than the header — those are the cells that contained a tab.
- Fix those cells in the workbook and convert again.