novice here.
I am trying to read lines from a file, however a single line in a .txt
file has a \n
in the middle somewhere and while trying to read that line with .readline python cuts it in the middle and outputs as two lines.
when I copy and past the line to this window, it shows up as two lines. So i uploaded the file here: https://ufile.io/npt3n
also added screenshot of the file as it shows in txt file.
- this is group chat history exported from Whatsup..if you are wondering.
- Please help me to read one line completely as shown in txt file.
.
f= open("f.txt",mode='r',encoding='utf8')
for i in range(4):
lineText=f.readline()
print(lineText)
f.close()