CSV Files

oSP3D can handle data objects in a CSV (comma-separated value) file. The oSP3D CSV interface tries to follow the format specification given by the RFC4180 memo in [15] and adds some program-related ones. A typical file extension for a CSV file is .csv.

The following list summarizes the CSV file format specifications accepted by the oSP3D CSV reader interface:

  • Each record is located on a separate line, delimited by a line break (CRLF).

  • The last record in the file may or may not have an ending line break (CRLF).

  • There may be an optional or even required header line appearing as the first line of the file with the same format as normal record lines. The optional header record must contain the same number of fields as the longest record in the entire file. Its fields are interpreted as unique data object names corresponding to the fields in the file. Non-unique names are made unique by appending an underscore followed by a serial number.

  • Within the header and each record, there may be one or more fields, separated by a delimiter. Except for the header record, each record may consist of a different number of fields or no fields at all. oSP3D interprets these missing fields as missing data. Spaces are considered part of a field. The last field in the record must not be followed by a delimiter.

  • oSP3D is generally able to determine the delimiter automatically when one of these common delimiter characters is used: ,, ;, :. It also recognizes a tabbed space as a delimiter. You can manually change the suggested delimiter at any time.

  • Each field may or may not be enclosed in double quotes.

  • Fields containing double quotes and the delimiter must be enclosed in double quotes.

  • Fields containing line breaks (CRLF), even those enclosed in double quotes, are not supported.

  • If double quotes are used to enclose fields, then a double quote appearing inside a field must be escaped by preceding it with a backslash character (\).