<< CSV read write files CSV read write files csv_getToolboxPath >>

CSV read write files >> CSV read write files > csv_default

csv_default

Get or set defaults for csv files.

Calling Sequence

allvalues = csv_default()
value = csv_default(field)
bRes = csv_default(field, value)

Parameters

allvalues

a 6-by-2 matrix of strings, the values of all the fields. The first column contains the available fields, while the second column contains the current values.

field

a 1-by-1 matrix of strings, the name of the field to get or set. The available values of field are "separator", "decimal", "conversion", "precision", "regexp", "eol".

value

a 1-by-1 matrix of strings, the value of the field to get or set.

bRes

a 1-by-1 matrix of booleans, bRes is true if the value was correctly set, bRes is wrong is the value was not correct.

Description

This function allows to quiery or configure the options of the csv files. These options are used by the read and write function when the user does not specify them in the calling sequence.

The allvalues = csv_default() calling sequence returns the value of all the fields.

The value = csv_default(field) calling sequence returns the value corresponding to the given field.

The bRes = csv_default(field, value) calling sequence allows to set the value of the given field.

The available fields are the following.

Examples

// See all the available fields
allvalues = csv_default()
// Get the value of the "precision" field
value = csv_default("precision")
// Set the value of the "precision" field
bRes = csv_default("precision","%.17e") // Expected = %t
// Set the value of the "precision" field to 
// an impossible value
bRes = csv_default("precision","Ouch!") // Expected = %f

See Also

Authors

Copyright (C) 2010-2011 - DIGITEO - Allan CORNET

Copyright (C) 2011 - DIGITEO - Michael Baudin

<< CSV read write files CSV read write files csv_getToolboxPath >>