Skip to main content

How to make the most out of CSV exports

O
Written by Olivia Willson
Updated over 4 months ago

CSV exports are an essential part of many TWAICE solutions. To ensure consistency and usability across different systems and locales, we've established a standardized format for all CSV files exported from our platform.

This guide outlines the CSV export specifications and explains how you can reliably parse and utilize this data.

Shape

CSV Format Specification

To make CSV files consistently machine-readable and compatible with parsing scripts, all exports from TWAICE follow these rules:

Column Structure

  • Delimiter: Columns are separated by a comma (,).

  • Decimal Separator: Decimal values use a dot (.).

  • Thousand Separator: None – large numbers do not include thousand separators (e.g., 10000, not 10,000).

Column Naming Conventions

  • Units: If a column includes a unit, it is added as a suffix to the column name (e.g., temperature_degc)

  • Hierarchical Data: For hierarchical structures, column names reflect the customer’s custom level naming.

  • Component Identification: For columns that identify components, the component names

Date and Time Format

  • Date Format: YYYY-MM-DD (e.g., 2020-01-30)

  • Datetime Format: YYYY-MM-DDTHH:MM:SSZ (e.g., 2020-01-01T00:00:00Z)

  • All dates and datetimes are expressed in UTC, clearly indicated with a Z or +00:00.

Additional Notes

  • Empty Files: Even if the CSV file contains no data rows, the appropriate header row is still included.

  • String Escaping: Strings containing double quotes (") are escaped using RFC-4180 standards. For example: “foo” becomes “””foo””” in the CSV.

Shape

Consequences of This Standard

✅ Benefits

  • Consistent parsing: Customers can reuse parsing logic across CSV exports.

  • Unified experience: A consistent look and feel throughout all CSV files enhances usability.

⚠️ Limitations

  • Locale-specific behavior: Some versions of Microsoft Excel (especially under European locales) may not correctly interpret , as the separator and . as the decimal symbol by default.

❓ Why Not Use European Formatting?

Alternatives like using ; as the separator and , as the decimal symbol are common in European Excel settings. However:

  • This format creates parsing issues for users with US settings.

  • There's no universal standard for these regional formats.

  • Adjusting formats dynamically based on user location is error-prone and complicates automated parsing.

📥 Tips for Opening in Excel

If you're using Excel with a European locale:

  1. Open Excel.

  2. Go to Data → Get External Data → From Text.

  3. Choose your CSV file.

  4. In the import wizard, select:

  • Delimited

  • Comma as the delimiter

  • Adjust decimal/thousand separators in Advanced settings if necessary

Did this answer your question?