I got this text file I need to parse, and I am looking for the more efficient way to do it.
The file structure is known and looks like this :
[section]
key=value
key=value
[section]
key=value
[section]
key=value
I have no way to know in advance how many [section] I will read, nor how much key & value there is in each section.
I am trying to find the best way to store this file in a collection. So far, I figured that the best collection tu use would be a Map>, so that each [section] would have its associated key-value attached.
The problems I am having is mostly to handle blank lines, as I am looking for new sections with a simple :
if(line.charAt(0) == '[')
and obviously, with blank lines this returns null.
Can anyone just give me heads up on this ?