I usually read files like this in Python:
f = open(\'filename.txt\', \'r\')
for x in f:
doStuff(x)
f.close()
However, this splits the file
Open the file using open(), then use the file.read(x) method to read (approximately) the next x bytes from the file. You could keep requesting blocks of 4096 characters until you hit end-of-file.
You will have to implement the splitting yourself - you can take inspiration from the csv module, but I don't believe you can use it directly because it wasn't designed to deal with extremely long lines.