Your code assumes the same number of lines in the files, whereas apparently "Ratings.txt"
has fewer lines.
My recommendation would be to process the files in separate loops. When reading the ratings file, search through your customer list for the customer with the correct customer number.