Assuming your CSV contains the line:
'2013-05-25 23:59:59','-126125372','299134596','-1272989684','1826558680','-441013765','-441013765'
The code you just posted
Scanner x = new Scanner(new FileReader("c:\\test.csv"));
StringTokenizer token = new StringTokenizer(x.next());
will only capture '2013-05-25
as a String with x.next()
, see the javadoc for Scanner#next()
. From the javadoc,
A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace.
So next()
will return everything up to the next space as a String. Use nextLine()
instead, to return the full line.
StringTokenizer token = new StringTokenizer(x.nextLine());