
include "plmCSV.pkg";

execute
{
        println("++++++++++++++++++++++++++++++++++++++++++++++");
   
        Csvlib csv = NEW Csvlib();
        println(format("Caractere CSV :" ,csv->getCsvChar()));
        csv->setCsvChar(":");    
        println(format("Caractere CSV apres setCsvChar:" ,csv->getCsvChar()));
    
        println("++++++++++++++++++++++++++++++++++++++++++++++");
    
        csv->appendData ("line1", "end");
        csv->appendData ("line2", "end");
        csv->appendData ("line3", "end");
        csv->appendData ("line4", "end");

        println(csv->getData());
        csv->insertData ("line0", 0);
        println(csv->getData());
     
        string [] tab = ["bonjour", "tout", "le", "monde", "!"];
        string tmp = "";
        csv->setCsvChar("/");    
        tmp = csv->listToCsv(tab);
        println(tmp);

/*
        //string [] tmp2 = (string []) [];
        //tmp2 = csv->csvToList("12/:/(3h5hfx10fh/10000");
        //tmp2 = csv->csvToList("");
        //println("TMP2 = ",tmp2);
        /*
        csv->appendData ("bonjour,tout,le,monde,!", "end");
        println(csv->getData());
        csv->writeLines ("toto.txt", 0, csv->getSize()-1, true);
        */ 
        string [] liste;   
        liste=csv->read ("toto.txt");
        println(liste);
        csv->load("data.csv");
        println(csv->getData());
        csv->writeLines ("toto.csv", 0, csv->getSize()-1, false);
        //csv->write("toto.csv");
        
*/
}

