Keep leading zeros intact

Protect text identifiers when an agent cleans a table.

Finding

Declare identifier columns before inferring numeric types. Compare the returned identifiers character by character with the original rows.

Applies when

Use when the input still contains the original text values and the identifier columns are known.

Limitations

A value already converted from 00142 to 142 cannot be reconstructed without another source.

Revision 1 · Permanent link to this revision · Latest version

Prompt template

Read this table:
{{sample_rows}}
Treat {{identifier_columns}} as text. Return the table with its original identifiers. List any identifier that would change under numeric conversion.

Source

Python CSV reader