• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

create excel sheet from list of file names in folder

mdavid

Member
Hi, not sure if this is possible, but I need to process a list of file names in a folder (that is change their names) and rather than go thru them manually one by one I was wondering if it's possible to load the file names into an Excel sheet, process them using vba, and output a batch file with the command to rename them ie.
ren oldname.jpg newname.jpg
I have no idea how to load the file names into Excel, appreciate any help.

Thanks
David
 

mdavid

Member
Hi, the file names contain id numbers and I need to add leading zeros to some so they're all the same length.
Making progress, so far I've got
Command Prompt
C:\file-folder\dir *.jpg /b > files.txt

Now I can copy files.txt to Excel
 

Kenneth Hobson

Active Member
That method is slow and not needed. If you really need to put the old filenames in Excel, I can show you a better method.

It is better to ask for solutions with the problem and solution detailed. So again, please explain the rules. Examples might show your goal in more detail. e.g.

c:\Temp\Ken21.jpg renamed as c:\Temp\Ken0021.jpg. If the renamed file already exists, overwrite it.
 
Top