Example 1: Well-formed CSV passes
Every row has the same field count as the header and quoting is balanced, so the validator returns a clean status.
Input
id,name,email,city
1,Alice,alice@example.com,Seoul
2,Bob,bob@example.com,Tokyo
3,Carol,carol@example.com,Berlin
Output
Valid CSV
4 rows, 4 fields each
No errors found.
Example 2: Ragged row flagged by line
A manual edit drops a column from one record. The validator points at the exact line so you can fix it without scanning the file.
Input
id,name,email,city
1,Alice,alice@example.com,Seoul
2,Bob,bob@example.com
3,Carol,carol@example.com,Berlin
Output
Invalid CSV
Line 3: expected 4 fields, found 3
row: 2,Bob,bob@example.com
Example 3: Unterminated quote breaks the rest of the file
A missing closing quote makes the parser swallow every subsequent newline as part of the same field. The reported line points at where the corruption starts, not the symptom further down.
Input
id,name,note
1,Alice,"a quick note
2,Bob,plain note
3,Carol,another note
Output
Invalid CSV
Line 2: unterminated quoted field
Line 4: expected 3 fields, found 1