import pandas as pd 
import os


all_frames = []
for f in os.listdir("/config/workspace/LEAF/Collections/NEWProcess"):
    num = f.split(".")[1]
    date = f"{num[0:4]}/{num[4:6]}/{num[6:8]}"

    cl_df = pd.read_csv(f"/config/workspace/LEAF/Collections/NEWProcess/{f}")

    date_list = [date for _ in range(0, len(cl_df.index))]
    cl_df["CollectionsFileDate"] = date_list
    
    all_frames.append(cl_df)
    
combined = pd.concat(all_frames)
print(combined)
combined.to_excel("NewProcessForwardTest.xlsx", index=False)