Wenlo
Posted on Nov 14
AI-assisted
A supplier export contains a comma inside one item name, quotation marks inside another, and two quantities that cannot enter a positive-supplies report. We need more than a split on commas: preserve the text, isolate rejected records, write a new CSV, and prove that reading it back preserves the accepted items.
Run the example
All illustrative records are fictional. Save the following as csv_roundtrip_audit.py. The complete script was run in PythonIDE on iPhone, and the screenshots show its actual source and output.
import csv from pathlib import Path from tempfile import TemporaryDirectory
# Fictional workshop supplies; never touches user files.…