You must use a for loop to process the second input file nameslist2txt and write to the output file