Sign in to follow this  
Followers 0
Langusmon

Rename all files in folder

4 posts in this topic

Hello,

 

I am trying to take a folder that has say, 10,000 files in it, and add a .txt extenstion to the end of each either through the means of converting each file or renaming each file to put .txt on the end of the filename. The latter option I was thinking would be the easiest.

 

Im trying to use the the Repeat with Folder option, but am unable to figure out how to go through each file in the folder to do this.

 

Any help would be much appreciated!

Share this post


Link to post
Share on other sites

Hello,

 

I am trying to take a folder that has say, 10,000 files in it, and add a .txt extension to the end of each either through the means of converting each file or renaming each file to put .txt on the end of the file name. The latter option I was thinking would be the easiest.

 

I'm trying to use the the Repeat with Folder option, but am unable to figure out how to go through each file in the folder to do this.

 

Any help would be much appreciated!

 

I did something similar with a macro I wrote awhile back. What I ended up doing was writing a batch script that would navigate to the folder and make a file list. And then execute the batch scrip from with the Activate/Launch function in Macro Express. Here is some example batch script:

 

c:

cd "C:\Desired Folder Location"

dir /b /od > "Text File Name.TXT"

 

You will want to put that in a test file with a .BAT extension on it. That will then navigate to your folder and dump all the file names into the "Text File Name.TXT" file in the order they were created or modified. You can then use the Process Text File function in Macro Express to load the file names line by line then use the Rename function to make any changes that you need.

 

PS you can pass variables to batch scripts as well if you add command line paramaters. Variable in batch scripts start with %1 and ascend %2 %3 ect.

Share this post


Link to post
Share on other sites

Are you looking how to batch rename files easily. Try "KrojamSoft BatchRename program"..It is a great tool.

Share this post


Link to post
Share on other sites

You do not need a macro to do this. Old-style DOS commands make short work of the job of renaming files en masse.

 

1. In the "Run" dialog type "cmd" and press Enter.

 

2. You should now be at a DOS prompt.

3. Navigate to the folder you want to act on using "cd" (change directory) commands, e.g.,

cd c:\Users\SSmith\Links

4. To rename every file in the folder, type this at the prompt:

ren *.* *.*.txt    and then press Enter.

Translation: rename (ren) every file in this format:

name.extension

to this:

name.extension.txt

The "ren" command will rename the files in a blink of an eye.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0