Skip to main content
CSV Data Files

Describes the general format of CSV data files for use in managing data within the 4U Platform.

Updated over 2 years ago

General File Format

  1. The file should be in CSV format, end with a .csv extension, and be UTF-8 encoded.

  2. Lines should be terminated with a newline (LF).

  3. Lines beginning with # will be treated as a comment line. Comment lines can appear anywhere in the file.

  4. The first line that is not a comment must be the header row. The order of columns does not matter.

  5. Any extra columns will be ignored.

  6. All lines should have the same number of values and in the same order as the column header.

  7. Missing values should be left empty. For example:

    1. value 1,,value 3

  8. Values containing a line-break, double-quote or commas must be surrounded by double-quote characters. For example:

    1. value without comma,"value with a ,"

  9. Embedded double-quote characters must be represented by a pair of double-quote characters. For example:

    1. "Ada ""Enchantress of Numbers"" Lovelace",12-10-1815,11-27-1852

Metadata Comments

Metadata comments may optionally be included to describe the data and are used to validate that the actual data matches the expected data.

Metadata comments should be in the following format: #key:value. Metadata comments are not required.

Metadata comments that are supported are:

  1. row_count: the number of data rows that should be present in the file. The row count should exclude the header line and any comment lines.
    ​
    If row count validation is enabled, any file where the actual data row count is different than the specified row_count is considered invalid and will not be processed.
    ​

  2. generated_on: an ISO 8601 date or datetime format indicating when the file was generated. Examples: 2021-05-16T22:19:31Z or 2021-05-16.
    ​
    If validation of generated_on is enabled, any file where the generated_on is older than 26 hours is considered invalid and will not be processed. If the generated_on specifies a date without time, the file is considered to have been generated at the end-of-the day on the specified date. For example, 2021-05-16 is the equivalent of 2021-05-16T23:59:59.

Sample File

Sample file with metadata comments.

#generated_on:2021-05-16T22:19:31Z
user_id,email,first_name,last_name,entitlement,territory_id
234,ada.lovelace@example.com,Ada,Lovelace,home office,"Springfield, IL"
234,ada.lovelace@example.com,Ada,Lovelace,admin,PNW
456,grace.hopper@example.com,Grace,Hopper,field,branch7
#row_count:3

Please contact us at Support@4uplatform.com for additional assistance.

Did this answer your question?