I have an excel file that look like this -
Ticket # Status Person
1. Open John
2. Working Mark
3. Pending Betty
4. Working Mark
5. Open Mark
6. Open John
7. Pending Betty
8. Working John
9. Working Mark
10. Pending Betty
I want to extract following information
Names of all the different people (in column 3, in this case - John, Mark and Betty).
How many tickets for a person are a.Open b.Working c.Pending. (Eg - For John, 2 tickets are open, 1 is working and 0 is pending).
I am using Apache POI, please suggest, how I can get the above mentioned information.
Try to load Row by Row using this Class.
Cell have a method to return the string, create an implementation to read Name and if you dont have in your list create new object, if you have add one to the count of the ticket type.
Add the end the person object should take care of the way you store the information but you need to do it obtaining values cell by cell.
To obtain the information of your question just.
and
If you want all the unique members of a data structure, you use a TreeSet, which is wholly intended for that purpose, to wit:
Define your Comparator and hashCode method that differentiates on name -- the 3rd column and it will do what you'd like.