Page 1 of 1
Multiple renaming actions on copied files
Posted: 13 Sep 2013 21:55
by GamaRex
In Windows 7 I often use copy/paste to create a file backup, and then add a date to filename. Copy and paste of a file creates a filename with "- Copy" appended to the name. Currently, I do two XYplorer renaming operations:
Batch Rename to append date:
* <datem yyyy_mmdd>
Next, Search and Replace:
- Copy/
Is there a way to do these two operations with a single action?
Thanks.
Re: Multiple renaming actions on copied files
Posted: 13 Sep 2013 22:18
by Trasd
GamaRex wrote:In Windows 7 I often use copy/paste to create a file backup, and then add a date to filename. Copy and paste of a file creates a filename with "- Copy" appended to the name. Currently, I do two XYplorer renaming operations:
Batch Rename to append date:
* <datem yyyy_mmdd>
Next, Search and Replace:
- Copy/
Is there a way to do these two operations with a single action?
Thanks.
I've been wondering this myself, but as usual, I won't have access to my desktop for a bit.
I do quick backups the exact same way. Short of writing a script, I thought I could do this with RegEx, but I didn't know Don used a different
backreference character till recently. I wanted to try this, but won't be able to get to it for some time. I've been chomping at the bit to try it out.
Please let me know if you figure this out and I will do the same
Re: Multiple renaming actions on copied files
Posted: 13 Sep 2013 22:44
by highend
Code: Select all
foreach ($file, get("selectedItemsPathNames", "|"), "|") {
copyas '* <datem yyyy_mmdd>.?', get("Path", "i"), $file;
}
This would copy all selected files to the inactive pane to their correct name.
Double quotes around the date variable are wrong, single quotes are working fine.
Re: Multiple renaming actions on copied files
Posted: 13 Sep 2013 22:45
by Nighted
If I understand correctly, right click/hold, move, Copy Here with Current Date.
Re: Multiple renaming actions on copied files
Posted: 13 Sep 2013 22:48
by highend
Copy Here with Current Date.
You won't get the exact naming structure ("* <datem yyyy_mmdd>.?") with that command.
Re: Multiple renaming actions on copied files
Posted: 14 Sep 2013 02:36
by Trasd
GamaRex wrote:In Windows 7 I often use copy/paste to create a file backup, and then add a date to filename. Copy and paste of a file creates a filename with "- Copy" appended to the name. Currently, I do two XYplorer renaming operations:
Batch Rename to append date:
* <datem yyyy_mmdd>
Next, Search and Replace:
- Copy/
Is there a way to do these two operations with a single action?
Thanks.
I'm sorry, I completely misunderstood! I was thinking of something different.
You are looking for a batch copy with rename - hum, interesting and useful idea!
Re: Multiple renaming actions on copied files
Posted: 14 Sep 2013 03:12
by GamaRex
Nighted wrote:If I understand correctly, right click/hold, move, Copy Here with Current Date.
Nighted,
I think your suggestion will work for my purpose, with this modification:
Right-click, drag to the current folder's tab, choose Copy Here with Last Modified Date.
It doesn't match my date pattern exactly, but it's close enough and very simple to do.
I thought it might require a script to call up a couple of batch actions, but having this already in place as a feature is preferable.
Thanks!
I realize it would have helped if I'd made it clear that I was using the same folder for the copied files, but this technique will allow using the same folder (with my suggested modification) or to any other open folder's tab or pane.
Re: Multiple renaming actions on copied files
Posted: 14 Sep 2013 08:08
by Nighted
GamaRex wrote:Thanks!
I realize it would have helped if I'd made it clear that I was using the same folder for the copied files, but this technique will allow using the same folder (with my suggested modification) or to any other open folder's tab or pane.
I checked the XY settings INI for a tweak that would give more control over the format of the time stamp, but unfortunately could find none. There are other ways to do this, i.e. scripts, den4b Renamer, but that of course requires some more user input, or human.dll as the creator of nLite likes to refer to himself!

Re: Multiple renaming actions on copied files
Posted: 14 Sep 2013 09:44
by admin
GamaRex wrote:In Windows 7 I often use copy/paste to create a file backup, and then add a date to filename. Copy and paste of a file creates a filename with "- Copy" appended to the name. Currently, I do two XYplorer renaming operations:
Batch Rename to append date:
* <datem yyyy_mmdd>
Next, Search and Replace:
- Copy/
Is there a way to do these two operations with a single action?
Thanks.
Sure, I perform this action about 50 times a day for many years now.

It's built in in 2 ways:
1) Either drag-drop with right mouse button, then select from drop context menu: "Copy Here with Current Date" or "Copy Here with Last Modified Date"
2) Or, when you do it in place, use menu
File | Duplicate | Copy Here with Current Date (Ctrl+Shift+Alt+D) or
Copy Here with Last Modified Date (Ctrl+Shift+D)
Re: Multiple renaming actions on copied files
Posted: 14 Sep 2013 10:28
by highend
Or, as long as only files (and no folders) are involved (otherwise the script would need a bit of work):
Code: Select all
foreach ($file, get("selectedItemsPathNames", "|"), "|") {
copyas '* <datem yyyy_mmdd>.?', get("Path", "i"), $file;
}
Advantage: You'll get exactly that date format, that you prefer.
Re: Multiple renaming actions on copied files
Posted: 14 Sep 2013 10:50
by admin
You can customize the general date affix format here: Configuration | Templates | Date affix | Date affix (e.g. *-<date yyyymmdd>)
Re: Multiple renaming actions on copied files
Posted: 14 Sep 2013 15:59
by GamaRex
admin wrote:You can customize the general date affix format here: Configuration | Templates | Date affix | Date affix (e.g. *-<date yyyymmdd>)
I wondered if it would be possible to modify the date stamp format, and you showed that it is.
I modified my preference to *_<date yyyy_mmdd>
Many excellent suggestions here.
I'll probably alternate between the File, Duplicate menu option and dragging to the current tab for a while to see which I find easier.
I'll hang onto the code as well, in case I want to tinker with that.
Thank you everybody.
Re: Multiple renaming actions on copied files
Posted: 06 Oct 2023 01:00
by Lusayalumino
Wow, 10yo post and just made my life incredible.
I have CTRL+D mapped to "Copy Here With Current Date" but I do this many times a day, and have always manually affixed the Time Stamp in the format...
so instead of this:
filename.docx-20231005
I could get this:
filename.docx-20231005 16-59
But now I was able to change this: *-<date yyyymmdd> -- to this: *-<date yyyymmdd hh-mm>
Thanks for this old post!
Re: Multiple renaming actions on copied files
Posted: 15 Oct 2023 11:39
by admin
Great!

Things like this are the core mission of XY. Whenever you find yourself repeatedly doing something manually, drop me a note. I will write a machine to do the job.
Re: Multiple renaming actions on copied files
Posted: 15 Oct 2023 15:13
by Lusayalumino
You're the best... this software has not only transformed my productivity -- but made computing fun again. I wish I had found it many years ago.