Hi all,
I'm interested in parsing a fairly large text file in Java (1.6.x) and was wondering what approach(es) would be considered best practice?
The file will probably be about 1Mb in size, and will consist of thousands of entries along the lines of;
Entry
{
property1=value1
property2=value2
...
}
etc.
My first instinct is to use regular expressions, but I have no prior experience of using Java in a production environment, and so am unsure how powerful the java.util.regex classes are.
To clarify a bit, my application is going to be a web app (JSP) which parses the file in question and displays the various values it retrieves. There is only ever the one file which gets parsed (it resides in a 3rd party directory on the host).
The app will have a fairly low usage (maybe only a handful of users using it a couple of times a day), but it is vital that when they do use it, the information is retrieved as quickly as possible.
Also, are there any precautions to take around loading the file into memory every time it is parsed?
Can anyone recommend an approach to take here?
Thanks