Share

CSV file

[Desktop Automation]

The text file object represents a CSV file. The file consists of string entries inside a matrix of rows and colums (also known as fields). The matrix entries are called cells. The number of colums is defined by the first row. If you add a new row with more columns than the first row an error is thrown.

Properties

Property Read/write Type Description
rowlength read-only Number Returns the number of fields
tablelength read-only Number Returns the number of lines

Back to top

Methods

Name Syntax Description
appendfilewithentry CSVfile:appendfilewithentry(cell:string, lineending:Boolean); Appends one cell to the file. lineending is optional. When it is true, a newline is added at the end.
appendfilewithline CSVfile:appendfilewithline (line:string); Appends one line to the file.
getcell Field:string = CSVfile:getcell(row:number; field:number, replace:Boolean); Reads the cell at row and field. replace is optional. If it is true, quotation marks are removed.
readfile CSVfile:readfile(filename:string); Reads the file of filename from the file system.
savetofile CSVfile:savetofile(filename:string); Saves the CSV to a file of filename, overwrites an existing file depending on the Boolean value at creation of the object.

Back to top

Was this information helpful?