Skip to content

IO Functions

Method Definition Description Parameters Example
getCSVData(String fileName) Gets the value of the first columnNumber from the specified csv file. equivalent of calling getCSVData(fileName, 0, false) fileName: String indicating the name of the csv file to read data from. #{ioFunctions.getCSVData('myData.csv')} returns the first column in the csv file myData.csv.
getCSVData(String fileName, int columnIndex) Gets the value of the specified columnNumber from the specified csv file. equivalent of calling getCSVData(fileName, columnIndex, false) 1. fileName: String indicating the name of the csv file to read data from. 2. columnIndex: Integer Zero indexed column number. #{ioFunctions.getCSVData('myData.csv', 1, true)} returns the second column in the csv file myData.csv.
getCSVData(String fileName, int columnIndex, boolean loop) Gets the value of the specified columnNumber from the specified csv file. fileName: String indicating the name of the csv file to read data from.columnIndex: Integer Zero indexed column number.loop: Boolean true to go back to the first line after all lines are read. #{ioFunctions.getCSVData('myData.csv', 1, true)} returns the second column in the csv file myData.csv.
getFileData(String fileName) Reads the specified file and returns it as a String. fileName: String indicating the name of the csv file to read data from. #{ioFunctions.getFileData('myData.txt')} returns the contents of the file myData.txt as a String.
getFileBytes(String fileName) Reads the specified file and returns it as a byte array (byte[]). This function can only be used as input to another function that returns a String such as toBase64. fileName: String indicating the name of the csv file to read data from. #{ioFunctions.getFileBytes('myData.txt')} returns the contents of the file myData.txt as a String
Back to top