aspose file tools*
The moose likes Beginning Java and the fly likes Delimiter help please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Delimiter help please" Watch "Delimiter help please" New topic
Author

Delimiter help please

Josh Mark
Greenhorn

Joined: Mar 12, 2013
Posts: 2
Avengers,Joss Whedon,9.0
Panday,Carlo J. Caparas,6.9
Les Miserables,Tom Hooper,7.9

i'm suppose to add those above things from a text file to an arraylist.

and to add those to an arraylist the methods required goes at






I think here is my problem..




am i using the delimiter right to get the movie title, movie director, rating correct?
because of addMovie(String title, String director, double rating) . so if i want to add Avengers,Joss Whedon,9.0 should i use a delimeter
or is there an easier way..
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2854
    
  11

First, please UseCodeTags (⇐Click)

I would abandon the useDelimiter() method of Scanner. Instead read in a whole line (which you are doing already) and use the split() of the String class to divide the line into pieces.
 
Don't get me started about those stupid light bulbs.
 
subject: Delimiter help please