Okay, so i'm reading in a file with several lines formatted like this:
"Shania Twain: Greatest Hits" 2004 14.99 "Shania Twain"
how wouid my delimiter be set up so that it reads everything inside the first quotation marks, then the year as an int, then the amount (ex 14.99) and then everything in between the last quotations.
As in scanLine.next() would be == Shania Twain: Greatest Hits
scanLine.nextInt() == 2004
scanLine.nextDouble() == 14.99
and scanLine.next() == Shania Twain
in that order.
Thanks for your input.
My code atm:
processLine = scanner.nextLine();
Scanner scanLine = new Scanner(processLine);
scanLine.useDelimiter("\\s+"); and that reads from the first quote to the first space...
thanks for you help.
I was thinking about it, if I went through the string and removed the
marks from the string, all I would have to do is deliminate where there are two or more spaces which is scanLine.useDelimiter("\\s\\s"); or something like that right?
How do I go about removing the
from the string that I am reading in at the time?