aspose file tools*
The moose likes Java in General and the fly likes getting no such element exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "getting no such element exception " Watch "getting no such element exception " New topic
Author

getting no such element exception

Abhradeep Banerjee
Ranch Hand

Joined: Dec 09, 2009
Posts: 71
Hi,
Im getting a no such element exception... already tokenized the stuff




text file
1|S8470017G|Abhradeep Banerjee | Singapore |09/07/2007 | 13:28 | Kolkata, India | 09/01/2010 | 16:28
2|S22209619B|Debabrata Banerjee | Kolkata, India |09/08/2007 | 13:28 | Singapore| 09/01/2010 | 16:28
3|S8328944B|Debabrata Banerjee | Kolkata, India |09/08/2007 | 13:28 | Singapore | 09/01/2010 | 16:28
4|S8470017G|Abhradeep Banerjee | Singapore |09/07/2007 | 13:28 | Kolkata, India | 09/07/2007 | 16:28
5|S8470017G|Abhradeep Banerjee | Kolkata, India |09/08/2007 | 13:28 | Singapore| 09/08/2007 | 16:28

thanks

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Um... *where* are you getting the exception, and under what circumstances? It'll be easier to help if you provide all relevant information rather than making us guess.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
You should check that you have a next token before calling nextToken()
Abhradeep Banerjee
Ranch Hand

Joined: Dec 09, 2009
Posts: 71
err got it working no idea what caused it i just copied and pasted the contents of my text file from my backup and it worked..... all the data was the same except it started from 0 and not 1.
thanks
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
all the data was the same except it started from 0 and not 1
...and you had a carriage return at the end of your file
Abhradeep Banerjee
Ranch Hand

Joined: Dec 09, 2009
Posts: 71
what you mean by carriage return ???
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
At the end of your input file, you pressed the enter key to produce a new line that had not data.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting no such element exception