[back to index]

Library Reference (v 0.9.0)

Data

Reading in textfiles and CSV files.
Data.loadtext(textfile:String):Array
Loads in a .txt file from data/text/ as an array of Strings, split by newlines. The files needs to have the extension .txt.
Data.loadcsv(csvfile:String, delimiter = ","):Array<???>
Loads in a .csv file from data/text/ as an array of values.
Data.load2dcsv(csvfile:String, delimiter = ","):Array<?>
Loads in a two-dimensional .csv file from data/text/ as a 2d array of values. Use Data.width and Data.height to read the width and height of the loaded 2d CSV.
Data.blank2darray(width:Int, height:Int):Array?>>
Helpful function to give you a blank 2D array of given width and height!