我有一个代码可以在多个文本文件中找到一个字段并打印其值。而不是print(line [10]),我希望它打印beneficiaryName的值。
import glob
import errno
import csv
i = 0
path = 'C:/Users/Mallam Farouk Sanusi/Desktop/k/*.txt'
files = glob.glob(path)
for name in files:
try:
with open(name) as f:
csv.field_size_limit(1310720)
s = csv.reader(f)
for line in s: print(line[10])
i = i+1