CSV looks like the simplest format there is. Values, commas, line breaks. The trouble is that nothing in the file says which character separates fields, which encoding the bytes use, or what any column means.
To prepare CSV data for AI, we followed one troublesome order record (
00123, José Núñez, "Paid, then refunded", 10.50, 03/04/2026, empty status) through all seven checks. Using the repository's row-streaming CSV logic (0.1.8/0.1.9 semantics, while earlier local 0.1.7 differed on BOMs and padding), we tested both broken inputs and the repaired CSV.How LLMiser reads a CSV
LLMiser reads a .csv file as comma-separated values, guesses its text encoding from the bytes and writes one Markdown table. The first row becomes the header, and every row is padded to the widest row.
That's predictable, which makes it easy to prepare for. Each of the seven fixes below lines up with one of those steps.
1. Identify the delimiter
Make sure your file is actually separated by commas. Many regional exports use semicolons, and a semicolon file is read as comma-separated, so it splits at decimal commas instead of between fields.
When we ran our worked record as a semicolon export (
00123;José Núñez;Paid, then refunded;10,50;03/04/2026;), it split both inside the note's comma and at 10,50, jamming all six headers into column one. A separate Lee;10,50;Köln fixture split the exact same way, while .tsv files returned raw tab-separated text rather than a table.Open the file in a plain-text editor first and check line one. Re-export semicolon or tab exports as comma-separated UTF-8 before uploading.
2. Quote separators inside cells
Wrap any cell containing a comma, double quote or line break in double quotes per RFC 4180, section 2, doubling inner quote marks.
Compare the valid quoted worked record with an unquoted malformed version you can copy and inspect:
account_id,customer_name,note,amount_usd,order_date,status
00123,José Núñez,"Paid, then refunded",10.50,2026-03-04,unknown
00123,José Núñez,Paid, then refunded,10.50,2026-03-04,
Under RFC 4180, quoting keeps embedded commas, doubled quotes and embedded newlines together in one logical field. Separate from that CSV rule, LLMiser flattens embedded line breaks into single spaces when writing a Markdown table row (
"Line one\nLine two" became "Line one Line two" on our multiline quoted.csv test).Without quotes on our worked record,
" then refunded" shifted under amount, 10.50 moved under date and the trailing empty field created a seventh unnamed column. Exact alignment breaks quietly when commas go unquoted.3. Check text encoding
Save the file as UTF-8 before you convert it. Encoding is guessed from the bytes, and a guess can be wrong, especially for older exports in a regional code page.
Saved as Windows-1252, our test names and our worked record's
"José Núñez" both came out as "Josķ N·±ez", alongside "Z³rich". Saved as UTF-8, with or without a byte order mark, "José Núñez" and "Zürich" survived intact.A file that was already damaged once stays damaged, and can get worse. Our file containing "José," text misdecoded before it ever reached us, was guessed as a different encoding entirely and turned into Korean characters. Fix the source text first, then save it as UTF-8.
4. Give columns meaningful headers
Put one header row at the top with a clear name for every column. The first row always becomes the table header, so a file without one turns its first record into column names.
Without a header row, our worked record (
00123, José Núñez, "Paid, then refunded", 10.50, 2026-03-04) became the column names above row two. Our "Lee,10.50,Open" file lost Lee's row the same way, so a model counting records could miscount by one.RFC 4180 calls the header line optional, which is why so many exports skip it. For AI work, treat it as required. Use names like "customer_name" and "amount_usd" rather than "col1" or "value."
5. Make units and data types explicit
State units and types in the header names, because a CSV stores only text. There are no formats, currencies or dates in the file, only characters that a reader has to interpret.
Our worked record illustrates both rules. Because CSV cells read as literal text,
00123 kept its leading zeros intact (just like 02134 in a related probe). Before rewriting 03/04/2026, we confirmed the source system used month/day/year (March 4, 2026), so rewriting it to 2026-03-04 removed ambiguity rather than guessing. If you don't know whether a slashed date is month-first or day-first, confirm with the data owner instead of guessing.Write the unit into the header, such as
amount_usd or weight_kg, use clear ID headers like account_id, and convert confirmed dates to ISO format (2026-03-04).6. Inspect missing fields and row shape
Make every row carry the same number of fields as the header. Short rows get padded with blanks and long rows widen the whole table, so one stray delimiter changes the shape of everything.
On our ragged test file, a blank middle cell stayed empty, a short row padded cleanly and an extra trailing field added a fourth unnamed column. On our worked record, an empty
status cell and a five-field neighbor both left status blank. A model can't tell "none" from "unknown."RFC 4180 expects the header and every logical record to contain the exact same number of fields. Don't count raw commas on physical text lines, though. On our three-column
quoted.csv fixture, physical lines showed 2, 3, 2, 1, 1 raw commas because of an embedded comma in one cell and an embedded newline in another, while a proper CSV parser returned exact 3 fields for all 4 logical records. Parse using the export's delimiter and quoting rules, verify each logical record's field count against the header, and fill "unknown" or "none" where blanks matter.7. Test a small conversion sample
Convert the first twenty parsed logical records before converting the whole file. Taking a fixed slice of raw text lines (
head -n 20) can cut a multiline quoted field in half and invent a syntax error.Look at five things in that parsed sample: consistent column count, explicit unit headers like
amount_usd, preserved accents (José Núñez), intact leading zeros (00123) and your quoted note ("Paid, then refunded"). Replaying the repaired worked record cleanly through LLMiser's row-streaming logic returned one intact six-column Markdown row (00123 | José Núñez | Paid, then refunded | 10.50 | 2026-03-04 | unknown).LLMiser accepts .csv files up to 15 MB. For workbooks, sheets, formulas and merged cells are a separate set of problems. The use cases page covers where conversion helps, and the document to LLM pipeline guide covers the wider workflow.
Frequently Asked Questions
Does LLMiser detect semicolon-separated CSV files?
Not in our test. A semicolon file was read as comma-separated and split at its decimal commas. Export semicolon or tab files as comma-separated before converting.
What encoding should a CSV use for AI?
Save it as UTF-8. In our test, accented names saved as UTF-8 converted correctly whether a byte order mark was present or not, while Windows-1252 garbled them because the byte encoding guess misread it.
Why is a value in the wrong column?
Usually an unquoted comma inside a cell, or a row with an extra field. Quote any cell that contains a comma, quote mark or line break, and make sure every row has as many fields as the header.
Does a CSV keep leading zeros?
Yes, in our test. CSV conversion keeps cells as text, so 00123 and 02134 stayed intact. Check the file in a text editor first, since a spreadsheet may have removed the zeros before you saved it.
Can I convert a TSV file?
LLMiser accepts .tsv files, but in our test the output was the raw tab-separated text rather than a Markdown table. For a table, save the data as a comma-separated .csv and convert that.
Do blank cells cause problems?
Blank cells stay blank, which is fine when everyone knows what blank means. If blank could mean "unknown," "none" or "zero," write that value in instead of leaving the cell empty.
Ready to check a file? Convert a sample with LLMiser and compare it with the source before you share the full table.