0
Hello, I created the following code but it only applies the function of creating the txt file using the last record of the CSV table, as I can do for it to create a file for each record of this 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))
Follow the example CSV file:
nome,empresa,logo
Diego Rocha,Espaço Rocha,espacorocha.png
Adiana Bonfim,Bonfim Select,bonfim.png
Cris Matarazzo,Spazio Odontologia,spazio.png
Each file with a line:
Diego Rocha,Espaço Rocha,espacorocha.png
in an archive, in another archiveAdiana Bonfim,Bonfim Select,bonfim.png
etc.. Is that it? And the name of the archives?– Miguel