Hey guys.
I read in a csv file which contains 2 small lines.
String line = null;
try {
FileReader fr = new FileReader("c:/product/products2.csv");
BufferedReader br = new BufferedReader(fr);
while( null != (line = br.readLine() ) ) {
System.out.print(line +"\n");
}
}
catch (Exception e) {
e.printStackTrace();
}
works grand, but now i want to transfer the contents of br into an array so i can split the commas in the csv file and then transfer the single words of the csv file into an individual string variable.
The thing is i cant seem to figure out how to convert br (contents of csv file) into an array. I keep getting nullpointer errors if i try and put br in string array or arraylist. Can some one please point me in right direction.
Thanks
Mark