I have tested the code above with a txt file with 3868 lines:

the file looks like this:

this is my code:

The result is only 12 lines, While line length tells the length of a line is 9??? I do not understand this.

Any suggestions or help please, Thanks in advance!

I have tested the example with the following as result: