Python Forum
Saving as docx file from excel with new filename
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Saving as docx file from excel with new filename
#3
Hi again,

so this didn't do what I was thinking.

If you print the src_file it gives this:
C:\Users\Ron McMillan\Desktop\demo1.xlsx\demo1.xlsx

And the print dest_file gives this:
C:\Users\Ron McMillan\Desktop\demo1.xlsx\2035.xlsx (which is almost there if the demo1.xlsx part is removed)

What I need is for the dest_file to be this:
C:\Users\Ron McMillan\Desktop\2035.xlsx

I have been playing around with os.path.splitext and os.path.split as it seems I need to break up the path, and replace the filename with the newly generated number.But no progress.

Slightly breaking my mind as lost as to what to try. Am I even on the right path(no pun intended)
Reply


Messages In This Thread
RE: Saving as docx file from excel with new filename - by Chuck_Norwich - Oct-03-2019, 05:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python openyxl not updating Excel file MrBean12 1 411 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Copy Paste excel files based on the first letters of the file name Viento 2 512 Feb-07-2024, 12:24 PM
Last Post: Viento
  no module named 'docx' when importing docx MaartenRo 1 1,055 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Search Excel File with a list of values huzzug 4 1,318 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Updating sharepoint excel file odd results cubangt 1 937 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  Replace a text/word in docx file using Python Devan 4 3,846 Oct-17-2023, 06:03 PM
Last Post: Devan
  output provide the filename along with the input file processed. arjunaram 1 982 Apr-13-2023, 08:15 PM
Last Post: menator01
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,168 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Save and Close Excel File avd88 0 3,222 Feb-20-2023, 07:19 PM
Last Post: avd88
  Trying to access excel file on our sharepoint server but getting errors cubangt 0 865 Feb-16-2023, 08:11 PM
Last Post: cubangt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020