Gentee Programming Language > Documentation > Libraries Download documentation

Working with CSV data

Variables of the csv type allow you to work with data in the csv format.

string1_1,"string1_2",string1_3
string2_1,"string2_2",string2_3

For using this library, it is required to specify the file csv.ge (from Lib subfolder) with include command.

  • Operations
  • Methods

    Operations

    You should use the foreach operator to look through a csv object and get data from it.
     
    OperationSyntaxReturn typeComments
    foreachLooking through all items with the help of the foreach operator. An element in an object of the csv type is an array of strings arr of str. Each string is split into separate elements by the separator and these elements are written into the passed array.

    csv mycsv 
    uint i k 
    ... 
    foreach item, csv 
    { 
       print( "Item: \(++i)\n" ) 
       fornum k = 0, *item 
       { 
          print( "\(item[k])\n") 
       } 
    }

    Methods

    csv.appendAdding a data string
    csv.clearClearing data
    csv.readReading data
    csv.settingsSetting parameters
    csv.writeWriting data


     Copyright © 2004-2006 Gentee Inc. All rights reserved.