Can you list some sample contents of the input file that results in only one line of data in the new file.
Bear in mind the following
Bear in mind the following
line = ',baseball\n' print(line.endswith(',baseball')) line = line.strip() print(line.endswith(',baseball'))
Output:False
True
if the line end in special characters it won't match endswith
.