CSV Files

General Information

The file format CSV means comma-separated values (or sometimes character-separated values, since the separator does not necessarily have to be a comma) and describes the structure of a text file for saving or exchanging data with simple structures. The file extension is .csv. There is no general standard for this file format, but it is basically specified in RFC 4180. The character encoding to be used is not specified either. 7-bit ASCII is generally considered the lowest common denominator.

Characters with Special Functions

Some characters have a special function for structuring data within the text file.
  • one character is used for separating datasets This is usually the line break from the operating system where the file was created – in Windows you often have two different characters instead.
  • one character is used for separating data fields (columns) within the datasets („field terminator„).  Usually this is a comma. XQ:Campaign also allows semicolon, colon, tab or space.
  • In order to use special characters within the data (e.g. a comma or dot in decimal values), a field delimiter (also: text delimiter) is used, usually the quotation mark . If the field delimiter character itself is contained in the data it will be doubled.
The first dataset can be a header data record defining the column names, but it is not essential.

RFC Specifications

According to RFC 4180, Paragraph 2, Section 4 the amount of columns should always be equal – this is not always the case, especially Excel is well-konwon for not representing empty data fields by a separating field terminator. However XQ:Campaign always expects a field terminator, even if the data field does not contain a value. This is why a field separator needs to be chosen on exports as well.

Example for a CSV file:

Hour;Monday;Tuesday;Wednesday;Thursday;Friday 1;Maths;German;English;Maths;Art Education 2;Sports;French;History;Sports;History 3;Sports;“Religion pr;cath“;Art Education;Art Education

English EN Deutsch DE