Multiple renaming actions on copied files

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
GamaRex
Posts: 47
Joined: 13 Jan 2010 22:04

Multiple renaming actions on copied files

Post 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.

Trasd
Posts: 147
Joined: 19 Oct 2011 15:45

Re: Multiple renaming actions on copied files

Post 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
Trasd

"Any sufficiently advanced technology is indistinguishable from magic." A.C.C.

"I'll tell you this, no eternal reward will forgive us now for wasting the dawn." J. M.

highend
Posts: 13333
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Multiple renaming actions on copied files

Post 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.
Last edited by highend on 14 Sep 2013 10:30, edited 1 time in total.
One of my scripts helped you out? Please donate via Paypal

Nighted
Posts: 459
Joined: 21 Jan 2007 01:58
Location: Gitmo Nation North, Win 7/10/Linux/(x64)

Re: Multiple renaming actions on copied files

Post by Nighted »

If I understand correctly, right click/hold, move, Copy Here with Current Date.
I want XY to serve soft ice cream. Please Don, make XY serve soft ice cream.

highend
Posts: 13333
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Multiple renaming actions on copied files

Post by highend »

Copy Here with Current Date.
You won't get the exact naming structure ("* <datem yyyy_mmdd>.?") with that command.
One of my scripts helped you out? Please donate via Paypal

Trasd
Posts: 147
Joined: 19 Oct 2011 15:45

Re: Multiple renaming actions on copied files

Post 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!
Trasd

"Any sufficiently advanced technology is indistinguishable from magic." A.C.C.

"I'll tell you this, no eternal reward will forgive us now for wasting the dawn." J. M.

GamaRex
Posts: 47
Joined: 13 Jan 2010 22:04

Re: Multiple renaming actions on copied files

Post 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.

Nighted
Posts: 459
Joined: 21 Jan 2007 01:58
Location: Gitmo Nation North, Win 7/10/Linux/(x64)

Re: Multiple renaming actions on copied files

Post 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! :lol:
I want XY to serve soft ice cream. Please Don, make XY serve soft ice cream.

admin
Site Admin
Posts: 60622
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Multiple renaming actions on copied files

Post 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)

highend
Posts: 13333
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Multiple renaming actions on copied files

Post 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.
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60622
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Multiple renaming actions on copied files

Post by admin »

You can customize the general date affix format here: Configuration | Templates | Date affix | Date affix (e.g. *-<date yyyymmdd>)

GamaRex
Posts: 47
Joined: 13 Jan 2010 22:04

Re: Multiple renaming actions on copied files

Post 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.

Lusayalumino
Posts: 90
Joined: 13 Aug 2018 07:16
Location: USA

Re: Multiple renaming actions on copied files

Post 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!
XYPlorer, Great Form -- Awesome Function

admin
Site Admin
Posts: 60622
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Multiple renaming actions on copied files

Post by admin »

Great! :D 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.

Lusayalumino
Posts: 90
Joined: 13 Aug 2018 07:16
Location: USA

Re: Multiple renaming actions on copied files

Post 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.
XYPlorer, Great Form -- Awesome Function

Post Reply