Analysing a CSV file row by row
Placeholder
Written By Logiks Solutions
Last updated About 24 hours ago
What this does
You supply a CSV file and a question. The add-in reads the file in blocks, puts your question to the AI for each block, and writes the answers into your worksheet as a report – noting which lines of the file each answer refers to.
The typical case: an export with thousands of rows and the question which of them look wrong – duplicates, implausible amounts, missing mandatory fields.
The file itself is only read. It is not modified and not overwritten.
Where to find it
Home tab ▸ Logiks AI Assistant group ▸ Task menu ▸ Analyze ▸ Analyze CSV
First: an empty worksheet
The report is written into the active worksheet, starting at the row and column you specify later. Unlike the Data Extractor, the add-in does not ask whether anything is already there. It simply writes – and whatever was in those cells is overwritten.
So create an empty sheet first and switch to it. The report is two columns wide and grows as long as there are results; you cannot know in advance how many rows that will be.
Step 1: choose the file
.csv or .txt are expected. If you pick something else, the add-in asks whether to continue anyway.
Step 2: give the separator
"Enter the CSV separator (single character is recommended):" – the default is a semicolon. Files from English-language systems usually use a comma; some database exports use a tab.
The separator decides whether the header row is read correctly. If the next step shows only one column although the file has many, it was the wrong character.
Step 3: check the header and the row count
The add-in now shows you how many data rows the file has and which columns it recognised in the header, separated by vertical bars. Check both before confirming with Yes – this is the point where a wrong separator is still cheap to fix.
[IMAGE: excel-csv-header-en.png – the display of row count and recognised columns]
Step 4: the nine fields
[IMAGE: excel-csv-parameters-en.png – the CSV analysis parameter form]
- Prompt for analysis – your question to the AI, at least five characters. The more specific, the more usable the answers. "List every row where the amount is negative" gives you more than "check the data".
- CSV separator – again, in case you want to correct it.
- Columns to process – the column names from the header, strung together with the same separator. Empty means all. Narrowing it down pays off when the file has many columns that contribute nothing to your question.
- Chunk size in lines – how many rows the AI sees at once, 50 by default. Smaller blocks are more thorough and take longer; larger ones are faster but the AI is more likely to miss something.
- Starting line in file and Ending line in file – a section of the file. Two zeros mean the whole file. For a first test run, set 1 and 200 here.
- Result start line and Result start column – where the report begins in the worksheet. 1 and 1 mean A1. These two settings decide exactly which cells get overwritten.
- Number of attempts – how often a block is retried after an error, 2 by default.
Your entries are saved and are there again next time.
During the run
A progress window shows "Processing N of M lines…". You can cancel; the part of the report written so far stays in the sheet, and the message tells you how far it got.
Expect to wait on large files: at 5,000 rows and a chunk size of 50, that is a hundred requests one after another.
What the report looks like
At the top Analysis Report, then a header section with filename, date, your prompt, the model used, the chunk size and the columns processed. Then a header row with Line(s) and Result: on the left which lines of the file the finding refers to, on the right the finding itself. At the end an italic footer with the number of lines processed.
If there was nothing to report, it says "No findings."
Blocks whose answer could not be parsed even after the permitted attempts appear as their own row with an error message instead of a result. So you can see which part of the file was not checked.
Things to keep in mind
- The line reference in the report is to the data rows of the file, not to row numbers in Excel.
- The AI only ever sees one block. A question that would require an overview of the whole file – "which customer appears most often", say – cannot be answered this way.
- The report is a snapshot. If the file changes, you have to produce it again.
When something goes wrong
- "The file appears to be empty." – the file does not even have a header row.
- "These columns were not found in the header: …" – the name is misspelled, or you used a different separator than the file does.
- "The ending line must be greater than or equal to the starting line." – the two values are the wrong way round.
- "Please provide a more detailed prompt (at least 5 characters)." – the Prompt for analysis field is too short.
A practical routine
- Create a new, empty worksheet and switch to it.
- First run on a section (rows 1 to 200, say) to check the prompt.
- Sharpen the prompt until the answers hit what you are looking for.
- Then run the whole file.