-2
3 lists that form the directory and the file name, I want to concatenate the files "lists_tipos_anos.csv" (around 44 files) in "lists_tipos_all.csv" (generate 4 files), where the "all" is all the merge of the files from the list years:
- dfp_bpa_all.csv;
- dfp_bpp_all.csv;
- itr_bpa_all.csv;
- itr_bpp_all.csv.
follows a code that checks if the files exist: I only need the concatenation.
listas = ['dfp','itr']
tipos = ['bpa','bpp']
anos = range(2010, 2021)
path_csv = 'C:/Users/Saulo/Desktop/projeto analise/download/arquivos/dfs/%s'
arq_csv = '/%s_%s_%d.csv'
concatenar = []
for lts in listas:
for ano in anos:
for tps in tipos:
url = (path_csv % lts + arq_csv % (lts,tps,ano))
#print(url)
if os.path.isfile(url):
concatenar.append(url)
print(concatenar)
What is the content of
listas_tipos_anos.csv
?– Paulo Marques
content was already "treated", the separate files are equated in the structure, so I want to concatenate, only a file in csv distinguishing only listings
– Saulo
need to be in Python? is periodic? if not just copy
cp a.csv b.csv c.csv final.csv
– Paulo Marques