I have an ArrayList from recursively crawling through a directory
[project1_john_document1, project1_john_document2, project2_jose_document1, project2_jose_document2, project3_juan_document1, ...... ]
I am trying to count the instances for each project to get the following output
project1 = 3,
project2 = 2,
project3 = 1, ....
What I have done is to Iterate through the list but somehow I am stuck as to how to get the "project1" as a common project, as there are numerous project names on the directory. I tried splitting the string using the split("_"), but since I am entirely noob, I couldn't get the logic of classifying the different project name.
Newbie in java here and sorry for the vague phrasing of my question.