I have 3 commas separated files that I want to get data from and combine into a 4th file (csv). In the first file, the first element per line is used to search the second file for an exact match. Once it is found, the second element in that file (2nd file), is added to the elements of the first file. Then that element (the second one in second file) is used to search the 3rd file for an exact match. Once the match is found in the third file, the second and third elements of that file (3rd file) are added to the elements of the first file and second file. The resultant search with all the matches is written into the 4th file - line by line.

Example:
File 1
John, 10, 23, 14, Jill

File 2
Jeff, Mary
John, Vicky

File 3
Ian, 10, 34
Liz, 20, 12
Jeff, 45, 24
Vicky, 44, 55

File 4
John, 10, 23, 14, Jill, Vicky, 44, 55

Thank you for your help,
Nick