Overwrite existing files?

Bulk Rename Utility How-To's

Overwrite existing files?

Postby rob@marathonit.ca » Fri Aug 13, 2021 4:25 pm

So, what if the new filename already exists?

Does BRU just overwrite the existing file, does it save a copy of the existing file, does it skip that file?

I have a situation where a file sync product replaced thousands of my files: filename.ext ---> filename [computername].ext

JUST IN CASE the original files are still needed (say there are a few out of the bunch that, for some reason, shouldn't have been renamed), I'd like to have BRU do this:

Rename filename [computername].ext to filename.ext
Seeing that filename.ext already exists, rename it to filenameSAV.ext


Is that doable?

Or maybe there's a way of renaming filename.ext in a first step:

If exist filename[ computername].ext, rename filename.ext filenameSAV.ext
rename filename[ computername].ext to filename.ext

Make sense?
rob@marathonit.ca
 
Posts: 2
Joined: Fri Aug 13, 2021 4:12 pm

Re: Overwrite existing files?

Postby Luuk » Fri Aug 13, 2021 9:13 pm

The Bru will never overwrite files, unless first putting a checkmark in "Renaming Options, Advanced Options, Allow Overwrite".
There is also "Renaming Options, Prevent Duplicates" to always create unique names by appending _1, _2, _3, _etc, if needed.

But if wanting filenames like your explanation, first to remove both of those checkmarks above.
Then to rename your files using Replace(3) with a 'Replace' like...
\end\ [computername]

Click "Ignore All" if getting an error, saying that a filename cant be renamed (because the name already exists).
Then to fix the remaining files, just use a 'Replace' and 'With' like...
\end\ [computername]
SAV
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Overwrite existing files?

Postby rob@marathonit.ca » Fri Aug 13, 2021 9:33 pm

Thanks for the reply.

For purposes of simplicity, I am going to back up the folders containing this mess completely. Just in case I need to go back, fully (not likely) or partially (still not likely, but I'm a coward).

Then I will find and rename any files like xxxx [TRS-DC2].xxx (x's can be any filename character, no definite number of them) by removing " [TRS-DC2]" (note the leading space in the string to be removed.)

There are roughly 3,000 files in hundreds of folders, hence the need to try a bulk renaming tool, like this one.

Asking the tool to also rename the file it's replacing when renaming is too much to ask, and likely more than I really need anyway.


Thanks again for the reply.
rob@marathonit.ca
 
Posts: 2
Joined: Fri Aug 13, 2021 4:12 pm

Re: Overwrite existing files?

Postby hamad » Sat Sep 09, 2023 1:45 am

i have a similar problem i have multiple files ending with sequence like ~01 , 02. 03 and 04 and so on . i removed some files for example two files which ends with 03 and 04.
now i want to rename all files again i used numbering option to add numbering at the suffix but the BRU telling me there is a file with the same name already exist. how to make BRU rename all files again with suffix 01 02 03 04 and so on
hamad
 
Posts: 2
Joined: Sat Sep 09, 2023 1:29 am

Re: Overwrite existing files?

Postby Luuk » Wed Sep 13, 2023 11:15 am

@hamad...
It sounds like a sorting problem? But BRU cant overwrite files without "Renaming Options, Overwrite/Delete Files".
If removing the files in BRU, can either click the blue-arrows beside "Mask" or press "F5" to refresh the file-listing.

Should also present your names with the lowest numbers first, so might have to click the "Name" column in the file-listing.
If renaming many folders together, then Numbering(10) has a "Folder" checkmark, and can sort by "SubDir" in the file-listing.
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm


Return to How-To


cron