An AI-generated CSV can look tidy and still import the wrong records. A missing row, a guessed date, or an identifier stripped of its leading zeros may survive a quick visual check. Before loading the file into a spreadsheet, store, or database, compare it with its source and review how the destination will interpret each column.
This walkthrough uses a fictional five-row product list. It is an illustrative example, not a report of hands-on testing in a particular application.
1. Define what the file should contain
Start with the destination’s import template or documentation. Write down the exact headers, delimiter, required fields, encoding, and permitted date format. Decide how missing values should appear. An empty field, zero, and the word “unknown” can mean different things.
For this example, assume the source contains five products and the destination requires these columns: product_id, product_name, release_date, and stock. IDs are text, dates use YYYY-MM-DD, and stock is a nonnegative integer. One release date is unknown and must stay blank.
A suitable instruction to the AI would be: “Convert only the supplied records. Preserve identifiers and names exactly. Do not invent missing values. Use the four specified headers in order and return CSV only.” A clear prompt reduces ambiguity, but you still need to check the result.
2. Compare every record with the source
Here is the intended CSV for our fictional source:
product_id,product_name,release_date,stock
00101,"Notebook, pocket",2026-11-01,12
00102,Café mug,2026-11-02,8
00103,"Desk tray ""Mini""",2026-11-03,0
00104,Travel pouch,,5
00105,Pen set,2026-11-05,20
There are five data records, one header record, and four fields per record. The stock total is 45. That total is a useful cross-check, but it cannot prove accuracy: two incorrect quantities could cancel each other out.
Match records by product_id, not just by their position. Confirm that each expected ID appears once and that no extra ID exists. Then compare names, dates, and quantities. For this small file, review all five records. For larger files, use a full key and value comparison where possible; sampling alone cannot establish that nothing is missing.
Three errors would be easy to overlook here: changing 00101 to 101, replacing the unknown date with today’s date, or dropping the zero-stock product. Each would change the source’s meaning even if the CSV opened successfully.
3. Check headers, separators, and quotation marks
Open a copy in a plain-text editor first. Remove any introductory sentence, Markdown fence, or closing explanation the AI added. Check the header spelling and order against the import template, including unexpected spaces or duplicate names.
RFC 4180 documents common CSV conventions, including consistent field counts and quoting fields that contain commas, double quotes, or line breaks. A quote inside a quoted field is doubled. The RFC is informational; the destination’s documented requirements still matter.
In the example, the comma inside “Notebook, pocket” belongs to the name. The doubled quotes around “Mini” represent literal quotation marks. The adjacent commas after “Travel pouch” preserve an empty date field.
Use a CSV-aware parser or import preview to count fields. Splitting text at every comma would misread the first product. Likewise, counting physical lines can miscount records when quoted fields contain line breaks. Confirm the destination expects commas rather than tabs or semicolons.
4. Preserve encoding, IDs, and dates during import
Check that Café mug appears correctly in both the saved file and import preview. Garbled accented characters are a reason to stop and check encoding. Save in the encoding the destination requests, commonly UTF-8. Microsoft’s UTF-8 guidance for Excel explains the role of a byte-order mark and alternative text-import routes. Do not assume every destination wants a BOM.
For Excel, prefer a controlled text/CSV import over simply double-clicking the file. Microsoft’s import documentation warns that opening a CSV uses default data-format settings. Set the ID column to text before automatic conversion removes leading zeros. If conversion has already happened, return to the original file and re-import.
Check dates against the destination’s format and locale. A value such as 03/04/2026 needs clarification if the source convention is unknown. Even with year-first dates, verify the imported values rather than trusting their appearance. Keep the unknown date blank.
5. Review formula-like fields before opening them
CSV is plain text, but spreadsheet applications can interpret some cell contents as formulas. OWASP’s CSV injection guidance describes this risk and notes that no sanitization approach works universally across spreadsheet applications and downstream consumers.
Review untrusted text fields for formula-starting characters such as equals, plus, minus, and at signs, as well as leading control characters. Flag suspicious values for review instead of opening them casually or dismissing security warnings. Legitimate negative numbers need context, so avoid blanket deletion. Ordinary CSV quoting does not by itself neutralize formulas.
Final check before the production import
Keep the original source and an untouched CSV copy. Where available, use a validation preview or a test destination before importing into the live system. Confirm five accepted records, four correctly mapped fields, unchanged IDs, the accented name, the blank date, and stock totaling 45. Investigate rejected rows and unexpected conversions before proceeding.
If you later add calculations, follow our guide to testing an AI-generated spreadsheet formula. Accurate imported data is the starting point; any formulas built on it need their own checks.

