CSVUtil
A class to facilitate some basic CSV processing without having to worry about underlying csv library. Helps with reading and writing arrays to csv files. Generally, exceptions are squashed.
Functions
Reads all rows from a csv file that may have the first row as a header of column labels and each subsequent row as the data for each column, e.g. "x", "y" 1.1, 2.0 4.3, 6.4 etc. This method squelches any IOExceptions. Writes warning to log. If there was a problem an empty list is returned.
Reads all rows from a csv file that may have the first row as a header of column labels and each subsequent row as the data for each column, e.g. "x", "y" 1.1, 2.0 4.3, 6.4 etc. This method squelches any IOExceptions. Writes warning to log. If there was a problem an empty list is returned.
Reads data from a csv file that has the first row as a header of column labels and each subsequent row as the data for each column, e.g. "x", "y" 1.1, 2.0 4.3, 6.4 etc. The List names will hold ("x", "y"). If names has strings it will be cleared. The returned array will hold data0 = {1.1, 4.3} data1 = {2.0, 6.4} etc.
Reads data from a csv file that has the first row as a header of column labels and each subsequent row as the data for each row, e.g. "x", "y" 1.1, 2.0 4.3, 6.4 etc. The List names will hold ("x", "y"). If names has strings it will be cleared. The returned array will hold data0 = {1.1, 2.0} data1 = {4.3, 6.4} etc.
For compatibility purposes converts the list of CSV records to a list of string arrays
IOException is squelched with a warning to the logger if there was a problem writing to the file.