I am trying to merge some xls files, but when I run the script I don't get the expected result which would be a new file containing all the data from the originals, keeping structure etc. What I get is a lot of coded info and files paths
import pandas as pd
from glob import glob
planilhas_pasta = sorted(glob(r'C:\Users\de0186619\Documents\saldo_usuario_*.xls'))
planilhas_concatenadas = pd.concat((pd.read_csv(file, sep=';', header=3, encoding="ISO-8859-1", on_bad_lines='skip').assign(filename=file)
for file in planilhas_pasta), ignore_index=True)
print(planilhas_concatenadas)
The result I get is:
Lista de Usuá ... filename 0 ... C:\Users\de0186619\Documents\saldo_usuario_092... 3 thead: first-child { ... C:\Users\de0186619\Documents\saldo_usuario_092... 4 counter-reset: page ... C:\Users\de0186619\Documents\saldo_usuario_092...