I have a a few thousand files that need to be sorted into sub-directories by part of their file name.
e.g.
2022-03-02 - Bob's Meeting - Bob1.docx
2022-03-02 - Bob's Meeting - Bob3.docx
2022-03-02 - Bob's Meeting - Bob7.docx
2021-02-05 - Bob's Meeting - Jill2.docx
2021-02-05 - Bob's Meeting - Jill3.docx
Of course, this can be done in any number of ways.
However, I have used other renaming and media tools where in rename functions part of the rename rules may be a backslash. This creates a sub-directory, moves the files, and renames the files in one fell swoop.
It is a rather simple, elegant approach, but it seems to not exist in XY's renaming capabilities (if I have missed it, please point me towards it).
Proposal:
e.g. Search Replace: - /\
In this manner, all files would end up renamed as:
2022-03-02\Bob's Meeting - Bob1.docx
2022-03-02\Bob's Meeting - Bob3.docx
2022-03-02\Bob's Meeting - Bob7.docx
2021-02-05\Bob's Meeting - Jill2.docx
2021-02-05\Bob's Meeting - Jill3.docx
Which would create sub-directories of 2022-03-02 and 2021-02-05, then move the files "Bob's Meeting - Bob#.docx" into them.
Now all the files are sorted by their dates.
The same would work equally well with regex renames, and even media renames (e.g. move mp3's into sub-directories by their album)
Renaming operations - Allow "\" to create sub-directory
-
Jeeves
- Posts: 123
- Joined: 15 May 2008 07:57
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Renaming operations - Allow "\" to create sub-directory
\ is already taken byConfiguration | General | Sort and Rename | Rename | [x] Allow move on rename
So use a script / regex rename
One of my scripts helped you out? Please donate via Paypal
-
WirlyWirly
- Posts: 312
- Joined: 21 Oct 2020 23:33
- Location: XY 64-Bit | Win 10 @ 100% (3440x1440)
Re: Renaming operations - Allow "\" to create sub-directory
I do this from the rename special window when I use the ColunnEdit script: viewtopic.php?f=7&t=18752
Works great.
Works great.
-
Jeeves
- Posts: 123
- Joined: 15 May 2008 07:57
Re: Renaming operations - Allow "\" to create sub-directory
Thanks for pointing out that setting.
However, if I try a rename of: 2022/2022\ on the list below, nothing changes:
2022-03-02 - Bob's Meeting - Bob3.docx
2022-03-02 - Bob's Meeting - Bob7.docx
2021-02-05 - Bob's Meeting - Jill2.docx
2021-02-05 - Bob's Meeting - Jill3.docx
-
Jeeves
- Posts: 123
- Joined: 15 May 2008 07:57
Re: Renaming operations - Allow "\" to create sub-directory
Just a bit of clarification; I'm looking at search and replace renames. I manually did this with "Edit Item Name" and it worked. Just trying to figure out what I'm missing to make the most of this feature. Thanks!Jeeves wrote: ↑04 May 2022 18:21Thanks for pointing out that setting.
However, if I try a rename of: 2022/2022\ on the list below, nothing changes:
2022-03-02 - Bob's Meeting - Bob3.docx
2022-03-02 - Bob's Meeting - Bob7.docx
2021-02-05 - Bob's Meeting - Jill2.docx
2021-02-05 - Bob's Meeting - Jill3.docx
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Renaming operations - Allow "\" to create sub-directory
That
Again, use your text editor via my script that WirlyWirly mentioned or a script or a regex rename...
\ or any variation ..\... isn't suited for searching / replacing. It's for movingAgain, use your text editor via my script that WirlyWirly mentioned or a script or a regex rename...
One of my scripts helped you out? Please donate via Paypal
-
Jeeves
- Posts: 123
- Joined: 15 May 2008 07:57
Re: Renaming operations - Allow "\" to create sub-directory
After enabling "Allow move on rename", why can't I replace one word with another worth that has a trailing slash (thus making a sub-directory)?
The solution of 'use a script' is very much undesired NOR needed. Regex rename is powerful but often isn't necessary to go that far.
After kicking this around, I found that I can do exactly what I want;
For anyone who might find this post the answer is simply to escape it using another slash; like so:
Search Replace Pattern: 2022/2022\\
2022-03-02 - Bob's Meeting - Bob1.docx
becomes
2022\-03-02 - Bob's Meeting - Bob1.docx
Naturally some replacements do slightly undesired behavior when you're doing this mid-name:
Search Replace Pattern: meeting/meeting\\
2022-03-02 - Bob's Meeting - Bob1.docx
becomes
2022-03-02 - Bob's Meeting\ - Bob1.docx
Regardless, this is what I was after and works just fine.
XYplorer Beta Club