Java delimiter reader
- by newbieprogrammer
I have a colon-delimited text file containing grouped, related data. The People group contains people's names followed by their ages, separated by colons. How can I parse the text and group people according to their ages?
The structure is as follows:
Group.txt
Age:10:20:30:40:
Group:G1:10:G2:30:G3:20:G4:40:
People:Jack:10:Tom:30:Dick:20:Harry:10:Paul:10:Peter:20:
People:Mary:20:Lance:10:
And I want to display something like this:
G1 Jack Harry Paul Lance
G2 Dick Peter Marry
G3 Tom
G4