Sample Data file
INV1,A,BB,,,,
INV2,A,CC,,,,
INV3,C,BB,,,,
array getting only INV1 A and BB for first line, similarly INV2 a and CC for second and INV3 C and BB for third line. Remaining values are not considering.
My Code
BufferdReader bReader = new BufferedReader (new FileReader(/home/test.txt));
String line = "";
while ((line = bReader.readLine ()) !=null)
{
if (line != null)
{
String[] array = line.split(",") ;
for (String arrays : array ) {
System.out.println(arrays );
}
}
}
OUT PUT :
INV1
A
BB
INV2
A
CC
INV3
C
BB
Expected OUT PUT
INV1
A
BB
INV2
A
CC
INV3
C
BB