Link Search Menu Expand Document

CSVDocument.GetCells Method

Explanation Collects data in multiple columns of the specified row at once.
Added since Ver.4.1.2, Mobile Ver.3.0.0
Call format csvdoc.GetCells( row [, startcol [, endcol ] ] )
Return value Array of String objects of the retrieved cells
Arguments integer row Retrieved row that starts form 0 row index
integer startcol Start retrieval with column that start with index column 0
If the startcol is greater than the number of columns that actually exist, no columns will be retrieved. If startcol is omitted or a negative number is specified, the first column will be retrieved.
integer endcol End retrieval with column that start with index column 0
The columns before the specified column are retrieved up to one column.If endcol is less than startcol, no column is retrieved.If endcol is omitted or a value greater than the number of columns actually present is specified, the last column is retrieved.
Exception CSV-13 Incorrect row index
Example of use
    var csvdoc = new CSVDocument;
    csvdoc.Load(robj);
    
    /* Get the 3rd to 5th columns of the 2nd row */
    var cells = csvdoc.GetCells(1, 2, 5);
    for (var i = 0; i < cells.Length; i++) {
        print(cells[i], "\n");
    }
    
Related item SetCells, GetCell methods