I want to parse csv like following :
12:50 AM,11.0,10.0,94,1013,10.0,NNW,14.8,-,N/A,,Mostly Cloudy,330,2011-10-27 23:50:00
for parsing it I use a code like below :
while((mylines = rdr.readLine()) != null)
{
Pattern p = Pattern.compile("<br />");
mylines=mylines.replaceAll("<br />", "");
System.out.println(mylines);
StringTokenizer st = new StringTokenizer(mylines , ",");
while(st.hasMoreTokens())
{
System.out.println(st.nextToken());
}
}
for the 10th element which I call it Null I don't get any token response which is not good. how can I get token for all the elements?
regards