Page 1 of 1

Adding an extension to file names

PostPosted: Tue Oct 04, 2011 1:50 pm
by gordon_c
I have a Folder with 25 Subfolders which house about 750 files.
All these files are in .rtf format.
However, the filenames do not have the .rtf extension.
(If I "tell" Windows they are .rtf they will open satisfactorily,
But I would have to do so for every file.)
Can I ADD the extension to all these files (at a single shot) using the Section 11
of the BRU by entering .rtf and pressing RENAME ?

Re: Adding an extension to file names

PostPosted: Fri Oct 21, 2011 10:51 pm
by Jane
This should probably be posted in BRU support rather than command line.

The simplest way I can think of to add extensions is to use the Regex(1) section

Match: (.+)
Replace: \1.rtf

This will do the job, but it only works properly on files that have no extension.
If they do you end up with a double extension.

If you have a mixture of some with extensions and some without, use the following:

Match: ^([^.]+)$
Replace: \1.rtf

This only matches files that contain no extension dot and will ignore and not add .rtf to any files having an extension.

Make sure Include Ext. box is checked!

Give it a try,
Jane