
How to prepare a CSV for AI analysis
Preparing a CSV for AI analysis means making every column understandable before asking about trends. The file must represent the data correctly, and the question must specify the result you want.
This tutorial uses fictional support records. The aim is to create a verifiable input rather than upload an entire dataset and only later discover that dates or values were interpreted incorrectly.
1. Define what one row represents
Write a sentence describing the unit of analysis: one row might be a support interaction, sale or transaction. That choice changes how counts and averages should be interpreted.
For this exercise, each row is a completed support interaction. The identifier distinguishes records, while category and duration let us compare types of requests.
id,date,category,duration_min
A01,2026-10-01,registration,12
A02,2026-10-01,registration,8
A03,2026-10-02,payment,20
These records are invented for demonstration. The average duration of the two registration interactions is 10 minutes, giving you a simple reference for checking any generated result.
2. Check separators and fields
CSV is a text format for tabular data, and reading it correctly depends on recognizing its fields. RFC 4180 describes a convention using commas, an optional header and quotation marks for certain content.
In practice, confirm your file’s delimiter and decimal separator. Do not replace commas automatically without understanding whether they separate columns or belong inside a value.
Open a copy in a text editor and count the fields in several rows. If a description contains a comma, check how it is enclosed so the remaining columns do not shift.
3. Create a small data dictionary
A column name does not always explain what it means. Record the unit, format and missing-value policy before requesting calculations.
| Column | Definition | Check |
|---|---|---|
| id | Support interaction identifier | Look for duplicates |
| date | Completion date | Check the format |
| category | Request type | Standardize spelling |
| duration_min | Time in minutes | Distinguish empty from zero |
Do not replace an empty field with zero without an explicit rule. An interaction without a recorded duration is different from an interaction that took zero minutes.
4. Ask a bounded question
Your first analysis should produce a small result you can reproduce. Counts by category and average duration are useful exercises for this fictional sample.
Analyze this CSV sample as completed support interactions.
First confirm the columns, data types and any ambiguities.
Then count records by category and calculate average duration in minutes.
Show which values enter each calculation.
Do not treat missing values as zero without my confirmation.
If the environment cannot execute calculations, request the procedure or code to run in a suitable tool. A table written in an answer does not prove that the full file was processed.
5. Compare the sample with the original
Check row counts, duplicates and categories before accepting a summary. A sample helps test the method, but it does not justify conclusions about records that were never examined.
Use only the data required and an environment authorized for that content. Once the analysis is correct, repeat the procedure on the complete copy and record all filters and exclusions.
If you need calculated columns before analysis, see how to plan formulas with AI.
Frequently asked questions
What should I check before sending a CSV for analysis?
Check what each row represents, its delimiter, data types, duplicates and missing-value policy. Use only necessary data in an authorized environment.
Can I treat an empty field as zero?
Only when that is the defined rule for the column. Missing information and a zero value can represent different situations.
Does a table in an AI answer prove the whole file was analyzed?
No. Confirm that the file was processed and validate counts and calculations. A sample tests the method but cannot support conclusions about unexamined rows.