Package edu.pitt.isp.sverchkov.data
Class DataTools
java.lang.Object
edu.pitt.isp.sverchkov.data.DataTools
-
Field Summary
Fields -
Method Summary
-
Field Details
-
NEWLINE
ConstantNEWLINE="System.getProperty(line.separator)"
-
DELIMITER_REGEX
-
DELIMITER
-
-
Method Details
-
dataTableFromFile
Reads a data table from a file.- Parameters:
file
- The file to read from- Returns:
- The data table
- Throws:
FileNotFoundException
- if the file is not found
-
saveCSV
public static <Attribute,Value> void saveCSV(DataTable<Attribute, Value> data, File dest, boolean headers) throws IOExceptionSaves a data table to a file.- Type Parameters:
Attribute
- a Attribute classValue
- a Value class- Parameters:
data
- The data table to savedest
- The file to save toheaders
- Whether to include headers- Throws:
IOException
- if something goes wrong
-