Swastik Dey wrote:What is the field separator between the columns?
A couple of space.
John Jai wrote:
1. You might want to read the text files line by line. Now you read it token by token using the next() method.
2. You have to check for matches in the lines read such as whether its for memory / swap / total.
3. Read only the first three integer tokens from the line being processed - but make sure always total used and free sizes are always present. Else you might end up reading shared, buffers, and even cached values.
Thanks!! I will work on this and get back.
Mohamed Sanaulla wrote:Do you have a control over the format of the file? Or is it always a text file.
If you have control over the file contents or the format- you might want to consider using xml/json format.
I do have control over the file format. How is json going to help? I am very new to
java.