Encoding, decimal commas, and silent order-of-magnitude errors
Lesson 4 of 6 · Spreadsheets and instrument exports
1 · Learn the move · Red-team audit
A European instrument writes 1,5 for one-and-a-half; a parser reading US conventions sees one thousand five hundred, or fifteen, or a string, depending on its mood - and every one of those outcomes can run straight through to a plot without an error message. Encoding is the same class of silent: a cp1252 micro sign or degree symbol in a header breaks a naive utf-8 read, or worse, survives it mangled, and a column called Conc (ug/mL) becomes unrecognizable to the join that expected it. These are not exotic failures; they are what happens every time a file crosses an instrument, a locale, or a decade. The move is a red-team audit of the raw file before any parse: attack it looking for encoding, delimiter, decimal convention, and thousands separators, with evidence quoted for each finding - and a checksum row where a known value proves the parse read what the instrument wrote.
Red-team this raw file before parsing. Attack four fronts, quoting evidence for each finding: (1) ENCODING - non-ASCII bytes, where, and what they should be; (2) DELIMITER - what actually separates fields, including the semicolon-because-comma-is-decimal pattern; (3) DECIMAL CONVENTION - comma or point, with example values that prove it; (4) MAGNITUDE TRAPS - thousands separators, unit prefixes in headers, exponent notation. Then state the exact parse settings, and verify with this control: [a value you know, e.g. sample X concentration is about Y]. Raw file head and tail: [paste]
2 · Your turn. You write the prompt
A collaborating lab in Munich sent HPLC exports, and your first-pass numbers are absurd - concentrations a thousandfold high in some rows, and a column of what should be retention times parsing as text. It smells like decimal commas, but smelling is not knowing. Write the prompt that audits the file and proves the parse before a single downstream number is computed.
Remember: the AI sees only your prompt, not this page. If the situation isn't in your prompt, it doesn't exist.
Optional. These shape the output when you run your prompt below, not your score.