Avatar of Wm Allen Smith
Wm Allen Smith
 asked on

Using Python to Insert Filename into Column

Using Python to Insert Filename into Column


I have  a folder full of two-column  excel files. Column A has  attributes, Column B has values. I want to loop through the folder and insert a row at the top of the worksheet ("Sheet1")
and enter the values "Filename" in column A and  the actual filename in Column B (without the full path, just the file name). I have tried  creating two data frames, using concat, but has not worked.  Please  advise.
Python

Avatar of undefined
Last Comment
Subodh Tiwari (Neeraj)

8/22/2022 - Mon
Bhavesh Shah

ASKER CERTIFIED SOLUTION
Subodh Tiwari (Neeraj)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Wm Allen Smith

ASKER
Bingo! exactly what I was looking for! thanks so much!
Subodh Tiwari (Neeraj)

You're welcome! Glad it worked as desired.

Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy