Airfield Models

File Name Replacement Utility - Example

December 19, 2021



Home
About
Site Feedback
Register
Contact
Site Map
Add to Favorites
Comments
Search Airfield Models
Back to Back to File Name Replacement Utility

 

Airfield Models (http://www.airfieldmodels.com/)File Name Replacement Utility Example

This page demonstrates how to use the File Name Replacement Utility to fix a bunch of files that all have the same screwed up naming convention.

Until you're sure you know what you're doing (and even after that) I suggest that you always backup the files you want to rename.  I normally just navigate to the folder where the files are using Windows Explorer and create a new folder named "Backup."  Then I select the files and copy them into the new folder.  An easy way to do that is to select all the files then hold the CTRL key and drag the files into the Backup folder.  As a side note, almost every properly written Windows application allows you to copy using CTRL + (mouse) Drag on whatever you've selected.  Think about that next time you're writing a memo and have to enter duplicate text.

When the files are renamed correctly, delete the backup folder.  If you don't like how the files were renamed, delete the renamed files and copy back the files from the backup.  That's copy, not move.  Leave the backup files there until you're sure you don't need them.

This tutorial assumes you're pretty much computer illiterate.  If you scroll past the first few images you'll learn how to replace multiple parts of filenames in one shot.

 
 

Using the File Name Replacement Utility

Click the screenshots below to see full size images.  If clicking the image doesn't bring up a larger image then the image you see on this page is already full size.

This is the Main Window.  Before you can change any file names you have to locate them.

Use the Drive list box at the top left to select the drive where the files are located.

Navigate through the folders in the Folder list below the Drive list box.

Choose the type of files you want to find using the drop-down lists below the File list box.  If the type of file you're looking for isn't listed then you can type an asterisk (*) to find all files.

Type asterisk dot whatever to find files of a specific type.  if you want to find all files having an xyz extension, type *.xyz.

Stop rolling your eyes.  There really are people who don't know how to do this stuff.

If there is a large chunk of text I want to replace in every file name, I usually open Windows Explorer and copy it so that there is less of a chance of entering a typo.

You can double-click any file in the File List to open Windows Explorer in the folder where the file is.

Click the file name once to select it.  Wait a moment and then click it again.  The file name will now be editable.  Select the text you want to copy using your mouse.
Position your mouse over the selected text and right-click to bring up the context menu.  Click Copy.  Don't click Cut.

Now press the Enter key once or click anywhere else except that file to end the edit status.

Return to the Main window and click the "Replace This" box to position the cursor in it.  You can paste the copied text using any of the following methods:
  • Right click in the box and choose Paste from the popup menu.
  • Click Paste in the Edit menu.
  • Press CTRL + V on your keyboard.

Of course you don't have to do any of the above.  You can just type in what you want replaced.

Don't type anything in the "With This" box.  The text typed in the "Replace This" box will be replaced with nothing.  In other words, it will simply be removed from the file name(s).

Select the files that you want to rename.
Now click the Preview button to see how the files will be renamed.  The Preview window will open and has two lists.  The list on the left contains the original filenames.  The list on the right contains the new file names.

Clicking any file in the list on the left will also select the corresponding file in the list on the right and vice-versa.  In other words, if you want to know how a specific file will be renamed, just click it and the list on the right will highlight that file.

If there's a really screwed up file name in the right list and you want to know what file it used to be, click the file and the original file in the left list will be highlighted.

As you can see (well, if you click the image and make it big enough to see) the file names are now mostly correct.  There's still a wayward closing parentheses that annoys me.

Click Cancel and we'll change the replacement parameters to get rid of the little bastard.

Leave the existing text in the "Replace This" box.  Add a colon (:) at the end of the existing text.  Now type a closing parentheses.

In the "With This" box, just type a colon.  There's a colon there that's almost invisible size, but it's there and that's what matters.

Colons are used to separate replacement terms.  There is nothing before or after the colon in the "With This" box, so both terms in the "Replace This" box are replaced with nothing.  These replacement parameters will rename files to 01 filename.mp3.

Another thing you could do is type a space and a dash after the colon in the "With This" box so that the file names would be 01 - filename.mp3. 

Now click Preview again and you'll see that the file names are correct.  At least they're correct the way I like them.
If you're happy with the new file names you can click Continue With Renaming Operation in the Preview window or you can cancel the Preview window and then click Replace in the Main window.  Either way the same thing happens.  You'll be prompted to rename the files.  if you choose yes, the files will be renamed to what you saw in the preview window.

If you click Cancel in the Preview window or if you click No after clicking Continue or Rename then nothing happens.  Your files aren't renamed and you've successfully avoided taking another potentially devastating life-altering risk.

If you had the guts to click Rename, then when the renaming operation is complete you'll see the new file names in the file list.  If you're really unhappy with the way the files were renamed then remember that I told you to make a backup before you played with this very cool though admittedly limited-use toy.
 
 

Previous —
Next —

File Name Replacement Utility
Visual Basic Database (VB DB) Source Code

Comments about this article

 
 

Back to File Name Replacement Utility
Airfield Models Home

 
 

Copyright © 2007 Paul K. Johnson