This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 2833
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Delimiter help please
 
Similar Threads
cannot be applied to given types
[newbie] String.replace()/replaceAll() removed spaces
How do I get one program to take information out of another one.