Hello, I created the following code but it only applies the function to create the txt file using the last record of the CSV table, how do I get it to create a file for each record of that table?
import csv
import os
with open('lista.csv') as listacsv:
leitor = csv.DictReader(listacsv)
for row in leitor:
a = row['nome']
b = row['empresa']
os.mknod("{}_{}.txt".format(a,b))
The sample CSV file follows:
nome,empresa,logo
Diego Rocha,Espaço Rocha,espacorocha.png
Adiana Bonfim,Bonfim Select,bonfim.png
Cris Matarazzo,Spazio Odontologia,spazio.png