Sorry to be dense, but I can't find this question already answered, nor can I find an answer in the voluminous help, or if it is there, I'm not recognizing it.
I'm writing a book. Each chapter is in its own folder, and I go through lots of small revisions. *** I write and edit, save, close, go into File Manager (before I found XY!), ctrl-c, ctrl-v, and let FM make its default name. Then I reopen the main file and repeat from ***. Some chapters have slightly different versions with a unique base name, so my folders all have bazillions of files like
ReversingShapingComputer.odt
ReversingShapingComputer - Copy.odt
ReversingShapingComputer - Copy (2).odt
ReversingShapingComputer - Copy (3).odt
ReversingShapingComputer - Copy (4).odt
ReversingShapingPaper.odt
ReversingShapingPaper - Copy.odt
ReversingShapingPaper - Copy (2).odt
ReversingShapingPaper - Copy (3).odt
ReversingShapingPaper - Copy (4).odt
I've figured out how to add the modified date in my preferred format to these filenames, using Batch Rename with the string
* <datem -yyyymmdd-hhmmss>
Woo-hoo!
I'd like to delete all the stupidly designed default copy strings, from the initial space to the closing parenthesis. In *nix systems, I could send
s/ .*)//
to sed, so I tried
' .*)' > ''
but the regexp is not valid in XY, and switching single to double quotes doesn’t work either. What am I doing wrong? And naturally, deleting the ' .*)' and appending the modified date at the same time would be great. :-)
(I could not find the list of regexp tokens, even in the massive PDF. Again, my apologies for being dense.)
Renaming default Windows File Manager copies
Re: Renaming default Windows File Manager copies
Welcome to the forum
is still a meta character and needs to be escaped
In other words, the pattern for the regexreplace is:
Remove # from it, they were just used to show that there is a leading and a trailing space!
But be careful with such a pattern, it's greedy!
Better make it more specific like:
Code: Select all
)
In other words, the pattern for the regexreplace is:
Code: Select all
# .*\) > #
But be careful with such a pattern, it's greedy!
Better make it more specific like:
Code: Select all
# - copy \(\d+\) > #
Only possible via scripting (in one go)...and appending the modified date at the same time would be great. :-)
One of my scripts helped you out? Please donate via Paypal
Re: Renaming default Windows File Manager copies
Just to close the loop (mainly for others who are trying to do the same thing),
1. select the files
2. File | Batch Rename
3. put the following string in the box to append the file's modified date, indicated by the "m" in "datem" (adding or removing date components, time components, hyphens, underscores, etc.):
*-<datem yyyymmdd-hhmmss>
4. click preview, then OK
5. make sure same files are still selected
6. File | RegExp Rename
7. put the following string in the box changing each underscore to a space to remove copy numbers like "Copy (2)" as well as the first copy's " - Copy":
_-_Copy_\(\d+\)_>_
_-_Copy(_\(\d+\))?_>_
Thanks!
1. select the files
2. File | Batch Rename
3. put the following string in the box to append the file's modified date, indicated by the "m" in "datem" (adding or removing date components, time components, hyphens, underscores, etc.):
*-<datem yyyymmdd-hhmmss>
4. click preview, then OK
5. make sure same files are still selected
6. File | RegExp Rename
7. put the following string in the box changing each underscore to a space to remove copy numbers like "Copy (2)" as well as the first copy's " - Copy":
_-_Copy(_\(\d+\))?_>_
Thanks!
Last edited by ilexedits on 21 Aug 2017 16:59, edited 1 time in total.
Re: Renaming default Windows File Manager copies
No, your requirement was:as well as the first copy's " - Copy":
And the regex doesn't removefrom the initial space to the closing parenthesis
Code: Select all
_-_Copy
parenthesis (+ the number) afterwards...
You'd need e.g. this to do this as well:
Code: Select all
_-_Copy(_\(\d+\))?_>_
One of my scripts helped you out? Please donate via Paypal
Re: Renaming default Windows File Manager copies
Highend, thanks so much for catching this.
(I did some more poking, but I still can't find the regexp list of tokens, what needs escaping, etc.)
(I did some more poking, but I still can't find the regexp list of tokens, what needs escaping, etc.)
Re: Renaming default Windows File Manager copies
It's the Visual Basic 6.0 regex engine. Google should deliver all its details
One of my scripts helped you out? Please donate via Paypal
Re: Renaming default Windows File Manager copies
Marvy, thanks!