So I have about 3,000 csv files and they are all named differently. Example, CDEE.csv and the structure is just one line containing the name and an amount.
CDEE | 3993
I tried to concatenate and I keep getting
CDEE | 3993 | AASE| 3939 .........
but I want
CDEE | 3992
AASE | 3939
xxxx | yyyy
Here is the code: import pandas as pd import glob, os
path = "/home/username/myfolder"
os.chdir(path)
results = pd.DataFrame([])
for counter, file in enumerate(glob.glob(".csv*")):
namedf = pd.read_csv(file,skiprows=0, usecols=[1,2,3])
results = results.append(namedf)
results.to_csv('Combined.csv')
Thanks for any help, I really appreciate it!
cat *.csv > csv_files.allis looking pretty promising right now...