Home

CsvTable

CSV table

Operations

New

Constructor

New(data:String)
Parameters
NameTypeDescription
dataStringCSV data with CRNL line endings

Constructor

New(data:String, ending:String)
Parameters
NameTypeDescription
dataStringCSV data
endingStringline ending

AppendColumn

Appends a column to the end of the table

method : public : AppendColumn(name:String) ~ Bool
Parameters
NameTypeDescription
nameStringname of column to add

Return
TypeDescription
Boolture if column was added, false otherwise

ColumnValues

Get values for a given row

method : public : ColumnValues(index:Int) ~ CsvColumn
Parameters
NameTypeDescription
indexIntcolumn index

Return
TypeDescription
CsvColumnvalues for the given row

Get values for a given row

method : public : ColumnValues(name:String) ~ CsvColumn
Parameters
NameTypeDescription
nameStringcolumn name

Return
TypeDescription
CsvColumnvalues for the given row

Contains

Searches a given column for a string that contains a given

method : public : Contains(name:String, value:String) ~ Bool
Parameters
NameTypeDescription
nameStringcolumn name
valueStringvalue to search for

Return
TypeDescription
Booltrue if value is found, false otherwise

Searches a given column for a string that contains a given

method : public : Contains(index:Int, value:String) ~ Bool
Parameters
NameTypeDescription
indexIntcolumn index
valueStringvalue to search for

Return
TypeDescription
Booltrue if value is found, false otherwise

Count

Counts a column for matching values

method : public : Count(name:String, value:String) ~ Int
Parameters
NameTypeDescription
nameStringcolumn name
valueStringvalue to search for

Return
TypeDescription
Intnumber of occurrences

Counts a column for matching values

method : public : Count(index:Int, value:String) ~ Int
Parameters
NameTypeDescription
indexIntcolumn index
valueStringvalue to search for

Return
TypeDescription
Intnumber of occurrences

Delete

Removes a row from the table

method : public : Delete(id:Int) ~ Bool
Parameters
NameTypeDescription
idIntrow to delete

Return
TypeDescription
Booltrue if deleted false otherwise

Get

Gets an indexed row

method : public : Get(index:Int) ~ CsvRow
Parameters
NameTypeDescription
indexIntindex

Return
TypeDescription
CsvRowrow

GetHeaders

Gets header names

method : public : GetHeaders() ~ CsvRow
Return
TypeDescription
CsvRowheader names

GetRowId

Gets row name

method : public : GetRowId(name:String) ~ Int
Parameters
NameTypeDescription
nameStringname

Return
TypeDescription
Introw index

IsParsed

Returns rather the file has been successfully parsed

method : public : IsParsed() ~ Bool
Return
TypeDescription
Booltrue if successfully parsed, false otherwise

RowSize

Gets the size of rows

method : public : RowSize() ~ Int
Return
TypeDescription
Introw size

Search

Searches a given column for matching values

method : public : Search(name:String, value:String) ~ CsvTable
Parameters
NameTypeDescription
nameStringcolumn name
valueStringvalue to search for

Return
TypeDescription
CsvTabletable of matching results

Searches a given column for matching values

method : public : Search(index:Int, value:String) ~ CsvTable
Parameters
NameTypeDescription
indexIntcolumn index
valueStringvalue to search for

Return
TypeDescription
CsvTabletable of matching results

Size

Gets the number of rows

method : public : Size() ~ Int
Return
TypeDescription
Intnumber of rows

ToString

Formats the table into a string

method : public : ToString() ~ String
Return
TypeDescription
Stringstring representation of the table

UniqueColumnValues

Get unique values for a given row

method : public : UniqueColumnValues(name:String) ~ CsvColumn
Parameters
NameTypeDescription
nameStringcolumn name

Return
TypeDescription
CsvColumnunique values for the given row

Get unique values for a given row

method : public : UniqueColumnValues(index:Int) ~ CsvColumn
Parameters
NameTypeDescription
indexIntcolumn index

Return
TypeDescription
CsvColumnunique values for the given row