Caveat - I am a Python novice so this solution is unlikely to be bug free.
As you will now know from Solutions 1 and 2, the file is a continuous steam of characters, where the newline character separates the text into what we humans think of as "lines".
Solution 1 gave you a big clue as to an easy approach
Quote:
read in the file and look for the line-break markers
Read the entire file as a single string..
file = open('my_text_file',mode='r')
wholefile = file.read()
file.close()
You can then get a list of all of the "lines" from the file using
splitlines[
^] e.g.
listlines = wholefile.splitlines(false)
You could then extract the line you want from that list e.g. to get the 6th "line":
line6 = listlines[5]
There is a good discussion of the pros and cons of splitlines versus split by Danziger
here[
^]