<< Tableur Tableur csvRead >>

Aide de Scilab >> Tableur > csvDefault

csvDefault

Get or set defaults behavior for csv files.

Calling Sequence

allvalues = csvDefault()
value = csvDefault(field)
bRes = csvDefault(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", "encoding", "blank".

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 = csvDefault() calling sequence returns the value of all the fields.

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

The bRes = csvDefault(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 = csvDefault()
            // Get the value of the "precision" field
            value = csvDefault("precision")
            // Set the value of the "precision" field
            bRes = csvDefault("precision","%.17e") // Expected = %t
            // Set the value of the "precision" field to 
            // an impossible value
            bRes = csvDefault("precision","Ouch!") // Expected = %f

See Also

History

VersionDescription
5.4.0 Function introduced. Based on the 'csv_readwrite' module.
5.4.1 'blank' is enabled by default.

Report an issue
<< Tableur Tableur csvRead >>