Link Search Menu Expand Document

CSVDocument.Splice Method

Explanation Split CSV data according to the specified conditions.

Rows that setisfy the condition are removed from the CSVDocument object and stored in a new CSVDocument object.
Call format var csvdoc2 = csvdoc.Splice( row [, cond1 [, cond2, … ] ] )
Return value A new CSVDocument object consisting of only rows that satisfy the condition.
Arguments integer row Line number starting with 0 of the line that starts the split.

The row after the row specified by row is the target of division.
String cond Search conditions that specify the lines to be split

Specify in the same format as the Load method.

Can be specified as many search conditions as the number of columns at the maximum, and if multiple search conditions specified, combine them with AND.
Exception None
Example of use
    /* Rows where the first column is numeric and greater than 2001 and the second column is blank are stored in csvdoc2. */
    /* The other lines remain in csvdoc1. */
    var csvdoc1 = new CSVDocument;
    csvdoc1.Get("http://server/data1.csv");
    var csvdoc2 = csvdoc1.Splice(0, "0n>2001", "1==");
    
Related item Merge, Load methods