Being quite new to Java I would appreciate some tips on how to use the scanner. Need to parse rather large text files and have considered some different approaches - each with different problems, and can't decide which one is best.
The text format is something like this:
The file may start with any text for a number of lines. After a line break
[Date Time andAnyCharactersWithinBraces] Followed by text that could contain [Date time] and
span over several lines.
[Date Time andAnyCharactersWithinBraces] This is just another one...
For me the most obvious way would be to scan using a regexp delimiter matching the
[Date Time Tag]. Trying that I sometimes get
[Date Time Tag] Some text...]. This could probably be solve by using something like ^] instead of .*. But how do I get hold of the string that was matching? It seems I have ruled out the possibility to read [Date Time Tag] that should be connected to the text...
One other approach would be to read to EOF. This I think would work, but files are rather large (5-10MB). If I set the buffer to lower than the file size, wouldn