I need to take a CSV file and find the averages of each row and column. There is 922 rows & 11 columns. So far I have been able to print the values to the console, but they arent separated by rows and columns, just one value and then a new line. So far I have:
public static void main(String[] args) {
String fileName = "eeg.csv";
File file = new File(fileName);
try {
Scanner inputStream = new Scanner(file);
while (inputStream.hasNext()){
String data = inputStream.next();
System.out.println(data);
}
inputStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
I'd appreciate any help to sort the values back into rows & columns, and any advice on how to find the averages by row and column. Thank you.