I have a Example.txt file like the following:
Fu
ih
✌
te
eirt
a
nq
awi
oq
qu
acisrrtr
qopa
My real .txt file is much longer.
Now I want to read in line 2, 5, 8, 11, ... in a list with Python.
I tried to read in every line and take then only the certain lines from the list but the problem is that I can't read in symbols like ✌, and (which occur only in line 3, 6, 9, 12, ...).
I tried the following Python code to do this but it didn't work:
Column1 = []
pfad = r"C:/Users/.../"
with open(pfad + "Example1.txt", "r") as f:
reader = csv.reader(f, delimiter = '\n')
for row in reader:
Column1.append(row[0])
I also tried
f.readlines()
instead of
csv.reader
but it isn't working neither.
Can someone please help me?
Best regards
Fab_Freak