You are not logged in. Click here to log in.

Application Lifecycle Management

Search In Project

Search inClear

Tags:  not added yet

CSV Data Files

OMS can use data in CSV format for tabular input and output. There are some assumptions about the structure of an OMS CSV file in order to use it for data reading/writing.

Tables

A table is stored as an ASCII file using the CSV standard. The file has the extension .csv. The content is stored as comma separated values. Tables may have comment lines, which start with the pound symbol # in the first column. Empty lines are allowed anywere in a table and get ignored. Tables consists of columns and rows, and optional table meta data. Columns may have a type and optional meta data. Meta data is organized as pair key, value.

A table requires two key words, @table and @header. The @table keyword tags the start of a table definition, the @header tag starts a column definition. Both tags are case insensitive.

Tables can be generated using any text editor. Spreadsheet tools usually do allow the export into a CSV file.

Example

@Table,Example DataSet
Created,5/11/06
Author,OlafDavidA
@Header,time,b,c
Type,Date,Real,Real
Format,yyyy-MM-dd,#0000.00,#000.0000
,2006-05-12,0000.00,001.1000
,2006-05-13,0001.00,002.1000
,2006-05-14,0002.00,003.1000
,2006-05-15,0003.00,004.1000
,2006-05-16,0004.00,005.1000
,2006-05-17,0005.00,006.1000
,2006-05-18,0006.00,007.1000

A CSV file consists of three main sections:

  • The table header, indicated by @Table, followed by the name of the table. The next lines may have table level meta data, one meta data entry per line. Meta data is optional.
  • The table header is followed by the column header, indicated by the @Header keyword. Next to this all the column names are listed. The next lines may contain column meta data, starting with the key, followed by the values for each column (Example above shows Type and Format for the columns).
  • Data rows start with a ',' as the first character; values are comma separated.

A minimal table with no optional meta data looks like this:

@table, example data table
@header a, b, c
, 1,2,3
, 4,5,6
... more data

Such a table even looks O.K. when opened in Excel

@TableExample DataSet
Created5/11/06
AuthorOlafDavidA
@Headertimebc
TypeDateRealReal
Formatyyyy-MM-dd#0000.00#000.0000
2006-05-120000.00001.1000
2006-05-130001.00002.1000
2006-05-140002.00003.1000
2006-05-150003.00004.1000
2006-05-160004.00005.1000
2006-05-170005.00006.1000
2006-05-180006.00007.1000

Data Types

The are the follwing types available:
  • Date
  • Real
  • Boolean
  • Integer
  • String
If no Type information is given, the assumed type is String.

Data Formattiing

Data in each column has to have a Type and may have a Format. If a column has the type date, it is required to have a Format meta data record. The Format information is being used by OMS either to parse the file is used as input, or it was used to write it out. For numerical data the format is optional if the data values can be parsed with no problems (means: no localized formatting)

Format Patterns according to Sun's specification must be used:

If a pattern contains a comma, the format string and all data values for this column need to be quoted.

CSV References