I have an example of my idea in a 1d array. It will only output the columns. My idea is to use a 2d array to select the row and column. Here my code:
String
It's better to use an ArrayList of 1D String arrays, instead of a 2D String array.
String fName = "c:\\csv\\myfile.csv";
String thisLine;
FileInputStream fis = new FileInputStream(fName);
DataInputStream myInput = new DataInputStream(fis);
ArrayList strar = new ArrayList();
while ((thisLine = myInput.readLine()) != null) {
strar.add(thisLine.split(";"));
}
Note: Also you need to handle the IOException here.