this feature should be used with care, we recommend to ask confirmation to the user.

// 1. convert the file to an Arrayvar myArray =jQuery.csvIn.toArray( csvText );
// 2. Guess whether the first row is a headervar headerCheck =jQuery.csvIn.isHeader( myArray[0]);
// returns true or false// 3. show converted data to the user and make him confirm whether the first row is actually a header

1.4 cvIn.isHeader (firstRow) guesses whether the first row is a header or not. firstRow must be the first element returned by cvIn.toArray

Available options

You can specify options using object literal notation. You can combine any of the available options for the function you are using. In case you do not specify some options, their default values will be used.

Options for cvIn.toArray:

delim: column delimitor, comma by default,

quote: quote marker, double quote by default,

lined: row delimitor, \r\n by default,

startLine: first line to return, 0 by default,

endLine: last line to return, -1 by default (extraction until last line),

excludedColumns: list of columns which should not be returned, empty array by default (returns all columns).

cvIn.toJSON accepts same options than cvIn.toArray plus an extra: customHeaders, which should be an array of strings column titles. If not specified, the first row of the csv will be used for the column titles.

cvIn.detectDelimitor uses quote and lined options.

cvIn.isHeader function does not accept any option.

Overriding default options

You can override default options. Then any call to the functions without a second parameter will use the new default you have specified.