Link Search Menu Expand Document

CSVDocument.SetColumnName Method

Explanation Set the name of the column.

Column names can represent object names and property names, as well as simply used as names, and can be copied when copying CSV data to an array with the [] << CSV constant operator or [] << CSVDocument operator. The destination object or property can be explicitly specified.
Call format csvdoc.SetColumnName( column, name )
Return value None
Arguments integer column Column number 0 to set the name of column
String name Column name

If empty string is specified, the column name will be deleted.
Exception CSV-14 Incorrect column index
Example of use
    var csvdoc = new CSVDocument;
    csvdoc.Get("http://server/test.csv");
    csvdoc.SetColumnName(0, "c1");
    csvdoc.SetColumnName(1, "c2");
    csvdoc.SetColumnName(2, "c3");
    
    var csvdoc = new CSVDocument;
    csvdoc.Get("http://server/test2.csv");
    csvdoc.SetColumnName(0, ".Title");
    csvdoc.SetColumnName(1, ".Value");
    ListBox1.ListItem1 << csvdoc;
    
Related item GetColumnName, ClearColumnName, GetCellByName, SetCellByName methods
[ ] << CSV constants, [ ] << CSVDocument operators