Class: WritableCSVChannel

Represents a WritableCSVChannel, which could be used to write records from the CSV file.

Constructor

Constructs a CSV channel from a CharacterChannel to read/write CSV records.

init (WritableCharacterChannel characterChannel, Separator fs)
  • fs Separator ","
  • Field separator, which will separate the records in the CSV

Methods

write

Writes the record to a given CSV file.

close

Closes the io:WritableCSVChannel.

write

function write(string[ ] csvRecord) returns Error?
Isolated Function

Writes the record to a given CSV file.

1io:Error err = csvChannel.write(record);

Parameters

  • csvRecord string[ ]
  • A record to be written to the channel

Return Type

(Error?)

An io:Error if the record could not be written properly

close

function close() returns Error?
Isolated Function

Closes the io:WritableCSVChannel. After a channel is closed, any further writing operations will cause an error.

1io:Error? err = csvChannel.close();

Return Type

(Error?)

() or else an io:Error if any error occurred