i m trying to extract a specific column from a arabic file to another file this is my code
# coding=utf-8
import csv
from os import open
file = open('jamid.csv', 'r', encoding='utf-8')
test = csv.reader(file)
f = open('col.txt','w+', 'wb' ,encoding='utf-8')
for row in test:
if len(row[0].split("\t"))>3 :
f.write((row[0].split("\t"))[3].encode("utf-8"))
f.close()
and the file is like this :
4 جَوَارِيفُ جواريف جرف اسم
18 حَرْقى حرقى حرق اسم
24 غَزَواتٌ غزوات غزو اِسْمٌ
i keep gitting the same error :
File "col.py", line 5, in <module> file = open('jamid.csv', 'r', encoding='utf-8')
TypeError: an integer is required (got type str)