Link Search Menu Expand Document

CSVDocument.Load Method

Explanation Load CSV data from Reader object.
Data before Load method is executed will be lost.

When reading CSV data from a WEB server or file,Get method can be used, but the Load method has more flexibility in functions such as being able to select the line to be read.

Added since Ver.4.2.0 starts from here -->
If the internal character code is Unicode CSV Document, the character code of the input CSV file is Unicode.
<--till here
Call format csvdoc.Load( reader [, cond1 [, cond2, … ] ] )
Return value None
Arguments Object reader Reader object ReaderObject from which to read (object that can use the ReadLine method)
String cond Search condition that specifies the row to read
Specify in the following format:-
column [mode] operator value
    


column Specify the search key column with a column number starting from 0
mode Specify "n" when comparing the search key as a numerical value (compared as a character string if omitted)
operator Specify the following comparison operators:-
Operator Explanation
== Equal to the value
!= Not equal to the value
> Greater than the value
>= Equal and greater the value
< Less than the value
<= Equal and less than the value
value Specify the value to be compared.
If comparing the same row of different column, specify the column index with [ ].

Example:-
"0==A"      1st column matches A row.
"1n>100" the 2nd column matches row that bigger than 100th row.
"2==[3]" 3rd and 4th column matches the same row.

For the Search condition, the Maximum can be specified same as the number of column, and if want to specify multiple condition, combine them with AND.
Exception CSV-8 Valid read object is not specified
CSV-9 Does not support ReadLine() method
Example of use
    var csvdoc = new CSVDocument;
    var res = session.get("/test/sample.csv");
    csvdoc.Load(res, "1n>100", "2==[3]");
    
Related item Save, Get, Parse methods