0

I have thousands of files to be renamed in several subfolders in the main folder. The existing file name, path, and the new file name are available in an excel file. I have been using Excel VBA to do this earlier and now I am into Python and would like to accomplish this task using Python.

I am looking for a solution as below:

  1. Renaming the files in the same place

  2. Copying the files with folders to a new location and rename there to preserver the originals.

Please provide your valuable inputs.

4
  • What have you tried so far? You should probably take a look at os, glob and shutil modules, they have all the necessary functionality. Commented Dec 22, 2020 at 7:15
  • 1
    pathlib is better as it intuitively incorporates the modules mentioned above Commented Dec 22, 2020 at 7:18
  • If you have working VBA code, a starting point can be just rewriting that code with Python commands. If that gives you trouble, share your code here and get some answers. Commented Dec 22, 2020 at 7:29
  • You can check these out renaming and copying Commented Dec 22, 2020 at 9:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.