Please Help, I just can't figure it out. A friend helped with this but could not figure it our either.
I am trying to merge CSV rows together that have the same ID number, but have different values in the fields. I receive csv files weekly that can have different header names and sizes.
For example,
Read in this CSV file:
ID NAME PHONE EMAIL
22 John 555-1111
22 John 555-2222
john@aol.com
44 Bill 555-9999
Bill@aol.com
Should return:
ID NAME PHONE EMAIL PHONE0
22 John 555-1111 john@aol.com 555-2222
44 Bill 555-9999 Bill@aol.com
But it returns:
ID NAME PHONE EMAIL PHONE0 EMAIL0
22 John 555-1111 Bill@aol.com 555-2222 john@aol.com
44 Bill 555-9999
It does work correctly when I have this file:
ID NAME PHONE EMAIL
22 John 555-1111 john@aol.com
22 John 555-2222 john@aol.com
44 Bill 555-9999 Bill@aol.com
Here is my Code: