<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > CSV > cCSV class > <cCSV> constructor > <cCSV> properties > <CCSV>.Root |
Description
Retrieve column index for given column name.
Syntax
nCol = <cCSV>.Column.Index(sColumnName)
Returns
Number, 1 based column index whose name is sColumnName.
Parameters
Name |
Type |
Optional |
Meaning |
sColumnName |
String |
No |
Name of column |
Remarks
In case matching column was not found, 0 will be returned.
In case there are multiple columns of the same name, index of the first one with given name will be returned.
Restrictions
You can use this property after a call to <cCSV>.Load.
See also
Examples
uses "CSV", "console"
dim data as new cCSV
data.Load(APP_ScriptPath + "big.csv", True) ' Change to existing CSV file
printl $("Index of column 'Id': {data.Column.Index(""Id"")}")
waitkey