Page 1 of 1

Duplicating a file with a better name than " - Copy (<n>)"

Posted: 23 Aug 2017 20:14
by ilexedits
I'm writing a book, with each chapter in its own folder. I'm paranoid about losing material, so I frequently saved my current ODT, closed it, went out in my former file manager, made a copy of the base file, pasted it, then reopened the base file.

Someone somewhere thought it would be a good idea to use " - Copy (<n>)" on the end of the copy's filename. That's great until you have so many versions that you have to move the first thirty or forty somewhere else. Then those same names will start back over again. You can't move the next twenty tweaked files to the same place, because the names will all collide.

Enter XYplorer. I can make a DUPLICATE that adds the mod datestamp to the filename (Edit | Duplicate | Copy Here with Last Modified Date), customized to exactly what I want (Tools | Configuration, then under Colors and Styles, click Templates and put the desired affix in the "Date affix" box; mine is currently *-<date yyyymmdd-hhmmss).

And I have set up a pair of rename statements to fix all the stupid "- Copy (<n>)" names as well (a script is in the future to rip through all the archives).

For completeness for other sufferers, select all the files, then select File | Rename Special | Batch Rename. In the text box, put

Code: Select all

*-<datem yyyymmdd-hhmmss>
That adds the unique timestamp to the filenames. To remove the " - Copy" bit, with the files all still selected, select File | Rename Special | RegExp Rename. The regexp needed in that text box (change all underscores to spaces, though) is

Code: Select all

_-_Copy(_\(\d+\))?_>_

Re: Duplicating a file with a better name than " - Copy (<n>)"

Posted: 23 Aug 2017 20:23
by highend
I moved this to Tips & Tricks...

And for all those people with the same problem but a different language:
Exchange the

Code: Select all

Copy
part in

Code: Select all

_-_Copy(_\(\d+\))?_>_
to the word in your language...