如何将外部 .csv 文件中的列添加到现有项目?
我试图在网上找到解决方案,但没有成功。
使用您提供的文件,我在不到一分钟的时间内完成了此操作。
如果您了解一点 Python,请尝试 Jython。Edit Column > Add column based on this column并选择Language : Jython像这样:
import csv
#we are going to use DictReader to transform our imported rows into dict,
#so we can latter just refer to the column we want by its key i.e header
rows = csv.DictReader(open('/home/yourusername/Downloads/example.csv'), delimiter=",")
for row in rows:
return row['Comprar'] #'comprar' is the header of the column i want