base.Channel.setDelimiter()

SetDelimiter() is an optional method used to specify a delimiter other then the default one. The default delimiter is specified in the corresponding environment variable (DBDELIMITER) or, if it is not set, "|" is used. This method accepts a single parameter that is the delimiter sign surrounded by quotes.

An example of the method invocation is given below:

CALL chan_obj.setDelimiter("^")

If no argument is specified, the delimiter is set to NULL. In this case, the "\" symbol will not be used by Read() and Write() methods as an escape character.

It is possible to make the application read and write in Comma Separated Value format. To switch to this mode, pass "CSV" as the delimiter to the SetDelimiter() method.

CALL chan_obj.setDelimiter("CSV")

There are several differences between this format and the standard Channel format, they are listed below:

·         The file values may contain the double quotes (" ").

·         The values in the file must be surrounded by quotes. The coma or the newline symbols does not make the method escape the value processing.

·         The output value must be taken in quotes. If values contain double quotes, these symbols are doubled when sent to the output file.

·         If a read/write operation encounters a backslash symbol, it is read and the value is not escaped. The value should be taken in quotes.

·         Leading or trailing spaces are not truncated.

·         The record lines don’t have to end with an ending delimiter.