CVS DATA FILE FORMAT

 

The CSV file (comma-separated-values). CSV is one implementation of a delimited text file, which uses a comma to separate values.  The CSV file format is very simple and supported by almost all spreadsheets and database management systems.

 

The characteristics of these files are the following: 

 

The CSV (Comma-Separated Values) data files must have the following format:
 

attribute1, attribute2, ..., attributeN
value11, value12, ..., value1N
...
valueM1, valueM2, ..., valueMN

One example of valid CSV file is:

 

FirstName, LastName, Company, EmailAddress
Johnathan,Doe,"ABC Company","johndoe@abccompany.com"
Harrie,Wong,"Company Inc.","hwong@myprovider.com"
Mary,"Jo Smith","Any Corp.","mjsmith@myprovider.com"

In this example we can see the use of certain rules explained before, such as null value expressed in two consecutive commas, the use of the decimal point as a separator for real numbers and the use of double quotes to use the value of the comma simple as part of the data and not as a separator.

 

Another example of valid CSV file is:
 

OBS,CAREXPEND,DISPOSINC,DOLLARVALUE,WAGES
"1960:1",14.2,362,,270.7
"1960:2",14.1,365.9,,273.4
"1960:3",14.6,367.6,,273.9
"1960:4",13.2,369.2,,273.3
"1961:1",10.8,72.9,,273.7
"1961:2",11.7,378.4,,277.6
"1961:3",12.2,385.1,,282.2
"1961:4",13.7,393.2,,288.4