CSV data source connection string

Applies to Infiniti v8.0 or later


A CSV connection string is made up of the following parts:

Connection String field  Description
csv Path to the text file
fieldsNames Names of the fields in the order they appear in the text file. Comma delimited. Required
 widths Column-widths if the text file is a fixed width format. Use -1 for a variable width last column.
 delimiter Set a custom field delimiter. When this value is not supplied the default comma delimiter will be used.
 skipheaderrows If the text file contains header rows that need to be skipped. State the number of rows to ignore from the top of the CSV file.
 skipfooterrows If the text file contains footer rows that need to be skipped.
State the number of rows to ignore from the bottom of the CSV file.

Example Connection Strings:

csv=c:\temp\book1.csv;fields=Name,CategoryId;hdr=1;delimiter=|

csv=c:\temp\book1.csv;fields=Name,CategoryId;widths=5,10,11

csv=c:\temp\book1.csv;fields=Name,CategoryId;skipheaderrows=2;skipfooterrows=2

Example CSV with header and footer rows:
----------------------------------------------------------------------------------------------
CLIENT REPORT 01-01-2012
ID,fName,surnam
01,Ben,Smit
03,Sally,Jon
END OF FILE
----------------------------------------------------------------------------------------------
 

Related Articles

 

 

Keywords

 

cvs data source connection string