in reply to Re^2: compare two files and print the differences of file 2 in a third file
in thread compare two files and print the differences of file 2 in a third file

Your issue is that you are not reading GOODFILEproperly.

You thanked me for taking the time to look at your code.
I will now thank you to take the time to actually try the answer I gave you.

Click on the spoiler link below to see what the problem is.

I added a chompand printstatement after each of the while()statements, which is what I asked you to do.

Here's what I get when I run the modified version of your script:

Starting script Enter the GOOD file: GoodFile.txt Enter the BAD file: BadFile.txt GOODFILE line: 'GOODFILE' BADFILE line: 'Amimal, cat, 1, 4, YELLOW HAIR 3, HIGH 'this is a catt +t 1' BADFILE line: 'This section is the description of the animal bla bla +lbas.....bla bla lbas.....' BADFILE line: 'Amimal, cat, 3, 4, YELLOW LEG 3, HIGH 'this is a cattt + 1' BADFILE line: 'This section is the description of the animal bla bla +lbas.....bla bla lbas blaaaal........'

Look closely at the line which shows what data you are "reading" from GOODFILE.
Do you still think it is me who doesn't understand your problem?