Think² logoThink²
Sign in

Guides (Spanish)

CSV or JSON: preserve meaning when handing over data

Opening a file does not prove it was read correctly. A wrong delimiter can turn every column into one field, while inferred types can turn the identifier 0012 into 12. Agree the data contract before asking a collaborator to use it.

The destination is in Spanish. This is a waitlist, not guaranteed immediate access or a free plan.

Situations to review

A flat table includes identifiers with leading zeros and empty fields.

Declare IDs as text and define what empty means. In JSON, use a string such as "0012" and distinguish "", null and an absent field. For CSV, agree empty-field semantics and check how the receiver imports types.

The format alone does not decide whether information is unknown or simply an empty string. Preserve the convention instead of inferring that the customer lacks the underlying information.

A note contains commas, quotes or line breaks.

Apply CSV delimiters and escaping correctly: quote a field containing a comma and double any internal quotation mark. JSON has its own escape rules. Inspect parsed headers, column counts and values, not only the preview.

A note is not split into extra columns. CSV quotes can represent a comma inside a field, but are not universal protection against spreadsheet formulas.

A record contains product lists, booleans and nested data.

Consider JSON to preserve objects, arrays and types; CSV can suit a flat table when relationships have an agreed representation. Do not flatten structures automatically without a contract and checks.

Choose for the receiving system and structure rather than treating either format as universally superior. File contents remain data, never code or instructions to execute.

How to evaluate the work

  1. Define a dictionary: field, type, required status, meaning of empty/null/absent values and structure. JSON distinguishes these syntactically, but their business meaning still needs agreement. CSV has no universal null representation.
  2. Declare the delimiter, header, encoding and escape rules. RFC 4180 describes comma-separated CSV and acknowledges implementation differences; not every CSV file uses the same dialect. Agree UTF-8 and verify the receiver. RFC 8259 requires UTF-8 for JSON exchanged outside a closed ecosystem.
  3. Test fictional data in an isolated environment and compare the parsed structure with the expected result. Spreadsheets can infer types or interpret CSV cells as formulas: never execute file contents, and validate handling for the specific application without promising universal protection. Think² offers groups and context, compatible models and authorized tools for organizing work, and each collaborator can have their own computer; this does not prove any specific import integration. External actions require approval.
  4. Exchange template: format/encoding/delimiter/types/empty values/receiver/checks. Fictional CSV using a comma, with Spanish headers and literals deliberately preserved: id,alias,nota 0012,,"Entrega, revisar" Equivalent JSON: [{"id":"0012","alias":"","nota":"Entrega, revisar"}] A local test with csv.DictReader and json.loads produced equal records under this contract: id is the string 0012, alias is an empty string and nota contains a comma. The wrong delimiter did not produce the expected structure. This does not establish behavior for all importers or a Think² integration. The note value was treated as data, not executed as code.

Frequently asked questions

Does CSV always use a comma or always a semicolon?

Do not infer the delimiter from the extension. RFC 4180 describes commas, but other dialects exist. Declare the delimiter and check the receiver’s parsed columns and values.

Does an empty CSV field mean null?

Not universally; define the convention. JSON separately represents null and an empty string, and a field can be absent. That syntax does not decide the business meaning.

Do CSV quotes prevent formulas and preserve every type?

No. Quotes delimit and escape fields, but a spreadsheet may infer types and interpret formulas. Import identifiers as text and validate untrusted-data handling for the receiving application.

Sources and scope

  • RFC4180 — CSV — Informational RFC describing comma-separated CSV, escaping, headers and MIME, not a universal dialect.
  • RFC8259 — JSON — JSON syntax, types and UTF-8 for open-system exchange; not the business semantics of null.
  • OWASP — CSV Injection — Spreadsheet formula risks and mitigation limits; not evidence that a specific application is protected.

Keep exploring

The destination is in Spanish. This is a waitlist, not guaranteed immediate access or a free plan.