Hi
there is a csv file that contain 10 rows and two columns.
i want to convert this csv file to array.
each cell contains several line of string.
but the output is wrong.
after printing output, each cell of array contains a line of one cell of csv file.
for example csv file contain
book, this book is good. that book is good.
cook, cooking is enjoyable.
after printing output of array:
book,this one is good
that book is good, null
what is wrong with this code?
code is :
public static void main(String[] args) throws Exception { Scanner main = new Scanner(new File("C:\\Users\\a\\Desktop\\book1.csv")); int line=0; String [][] temp1=new String [10][2]; while (main.hasNext()) { temp1[line]=main.nextLine().split(","); line++; } }