parsing multiple delimiters
I have to input and parse the contents of a .txt file. I can do this using Scanner class and defining a delimiter (e.g. scanner.useDelimiter(",");)
However, my txt file has multiple delimiters. For example, this is a snippet of the file:
Question: Question text goes here Location: Chicago, IL School: Unit 5 Grade: 8 Question: Question 2 text goes here Location: Inglewood, CA School: Ben Franklin Elementary Grade: 4
So, basically, there are numerous delimiters (Question:, Location: School:, etc) and nothing that indicates the start of a new question. Note, I can't use : as a delimiter as it often appears in the text as a legitimate character
Can someone inform me on the best way to parse using multiple delimiters so it reads:
Question: Question Text
Location: Chicago, IL
School:
Grade: 8
Question: Question Text
Location: Inglewood, CA
School:
Grade: 4
thank you