Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem in reading null value present at the end in csv file

807603Feb 14 2008 — edited Feb 14 2008
I have a csv file in which at the last of each line is a null value or just comma is there.Whenever I use list.get(19)+""; it is throwing this exception
java.lang.IndexOutOfBoundsException: Index: 19, Size: 19

In csv file there are 20 columns in header and below that are the values written for these columns.So at last of each row there is no value or just comma is there.e.g
header: h1,h2,h3,h4
data:1,2,3,
3,y,4,
f,n,j,

Like this data is there.....
So how to get the last one from each row.........
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2008
Added on Feb 14 2008
11 comments
1,832 views