Link to home
Start Free TrialLog in
Avatar of Wm Allen Smith
Wm Allen Smith

asked on

Python Append/ Insert Filenames to Existing CSV

I have a process that loops through a source folder, goes to a particular sheet in  each workbook, and extracts row data  from that specified sheet, creates a dataframe and saves the data to a csv file. Is there a way to append  /insert into the csv  file    the file names of each file in the  source folder with out having to write that info into the source files?
Avatar of Norie

Do you mean you want to add a column to the dataframe to hold the file the row of data came from?
Avatar of Wm Allen Smith


Yes , that is correct-- I want to add a field in the dataframe to hold the name of the each file from the source folder.
Avatar of Arana (G.P.)
Arana (G.P.)

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial