CSV (comma separated text file) provides an easy way of storing simple tabular data. CSV files can be used to create datasources in the Data Services Server.
First, follow the steps in Creating Datasources. When you select CSV as the datasource type at the time a datasource is created, the CSV-specific options appear. For example:
The fields in the above page are as follows:
- CSV File Location: The sample csv file used in the above example is hosted by USGS, the science organization that hosts latest earthquake information in CSV files online. We use a sample file hosted online but you can also use one in your local machine.
- Column separator values:
- Single Character = "X" (X is any character), e.g. ","
- Tab = "\t"
- Space = "\s"
- Any Unicode Character = "\uXXXX" (XXXX is the hexadecimal unicode value)
- Start Reading From Row: The row number that reading will be started.
- Max. Rows to Read: Number of rows to read. If it is -1 the entire sheet will be read starting from the raw specified in "Start Reading From Row" field.
- Contains Column Header Row: If this is true, the first row will be considered as the header. It is ignored and the data from the next row is taken.
To write a query to this datasource, see Writing Data Service Queries.
Also, see a demonstration of service enabling a CSV file in CSV Sample.