I have a situation where I have a csv file as follows: Student Names, Address.
However, student names column could have duplicates so if that's the case i need to create a new file with only those duplicated student name and address - keep going until each file has no duplicated student names in a particular file.
Ie.
Student Names Address
John 5 West st.
David 42 Alan st.
John 22 Dees st.
Smith 2 King st.
David 77 Jack st.
John 33 King st.
Should be divided into 3 files like so: 1st File:
Student Names Address
John 5 West st.
David 42 Alan st.
Smith 2 King st.
2nd File:
Student Names Address
John 22 Dees st.
David 77 Jack st.
3rd File:
Student Names Address
John 33 King st.
My logic was to take the file put it into a DataTable and was to create a dictionary of Student Names -> Address -- However, Dictionary will not work because they keys are NOT unique. So my next logic was to create a list of Student Names and find out the duplicates from there and create a Datatable and create a file from there. I feel like this is more complicated as it is - Im pretty sure there must be an easier way in LiNQ - Could you guys help me out or shoot some pointers.
Thanks.
Lookup<Tkey,TValue>