Training Day

CSV

Understanding CSV format and its use in FileMaker integrations

What is CSV?

CSV (Comma-Separated Values) is a simple, text-based file format used to store tabular data. Each line in a CSV file represents a row of data, and columns are separated by commas. It's widely used for data exchange between different applications and databases.

Basic Structure

name,age,isActive,street,city,country,hobby1,hobby2,hobby3
John Doe,30,true,123 Main St,San Francisco,USA,reading,gaming,hiking
Jane Smith,28,false,456 Oak Ave,New York,USA,painting,cooking,traveling

Key Characteristics

  • Simple format: Easy to understand and create
  • Universal support: Nearly all spreadsheet programs and databases can work with CSV
  • Human-readable: Can be viewed and edited in any text editor
  • Compact: Minimal overhead for basic tabular data
  • Flat structure: No native support for hierarchical data (unlike JSON or XML)

Data Limitations

CSV has some limitations to be aware of:

  • No data typing: All values are treated as text by default
  • No standardized schema: Structure must be inferred or documented separately
  • Special character handling: Commas within text require special handling (usually quotation marks)
  • No nested structures: Cannot represent hierarchical data without flattening

CSV in FileMaker

FileMaker has excellent built-in support for working with CSV data:

Import Records

You can easily import CSV data using the Import Records script step:

Import Records [No dialog; "path/to/file.csv"; Create; UTF-8]

You can also access this through the File menu:

  1. Choose File > Import Records > File...
  2. Select your CSV file
  3. Map fields in the import dialog

Export Records

Exporting to CSV is just as straightforward:

Export Records [No dialog; "path/to/export.csv"]

Or through the menu:

  1. Choose File > Export Records
  2. Select CSV as the file type
  3. Configure field mapping

Text Functions

For more complex CSV operations, FileMaker's text manipulation functions can be used:

  • Use Substitute() to handle special characters
  • Use TextToList() (in newer versions) to parse CSV strings
  • Use Middle(), Left(), Right() with Position() in older versions

CSV's simplicity makes it an excellent choice for quick data exchanges between FileMaker and other systems when complex hierarchical data structures aren't required.

On this page