Package com.jml.util
Class FileManager
java.lang.Object
com.jml.util.FileManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[][]
readCSVtoDouble(String filePath)
Reads a CSV (comma seperated value) file into a 2D array of doubles.static String[][]
readCSVtoString(String filePath)
Reads a CSV (comma seperated value) file into a 2D array of String.static String
Reads content from a file.static void
stringToFile(String data, String filePath)
Writes a string to a file.
-
Method Details
-
stringToFile
Writes a string to a file.- Parameters:
data
- Raw data to write to file.filePath
- File path including file extension
-
readFile
Reads content from a file.- Parameters:
filePath
- File path including file extension of the file to load.- Returns:
- Raw content of file.
-
readCSVtoString
Reads a CSV (comma seperated value) file into a 2D array of String.- Parameters:
filePath
- File name including the extension. The extension must be .csv- Returns:
- The CSV file contents as a 2D array of Strings
-
readCSVtoDouble
Reads a CSV (comma seperated value) file into a 2D array of doubles.- Parameters:
filePath
- File name including the extension. The extension must be .csv- Returns:
- The CSV file contents as a 2D array of doubles
-