[help] a rename problem situation

Discussion related to "Everything" 1.5 Alpha.
Post Reply
asamirid
Posts: 127
Joined: Sat Oct 13, 2018 12:28 pm

[help] a rename problem situation

Post by asamirid »

greetings ..

i have a bulk of compressed files spriaded in a multilevel tree of folders ..

folders have it's represented names, but the files inside it has only numbers, like [1.zip 2.zip 3.zip ..], or [01.zip 02.zip 03.zip ..]
folder structure looks like this

[XYZ]
\_ 1.zip
\_ 2.zip
\_ 3.zip


now what i want to do, is renaming searched or selected files according to it's parent folder name, so [1.zip 2.zip 3.zip ..] files renamed to [XYZ_1.zip XYZ_2.zip XYZ_3.zip ..]

[XYZ]
\_ XYZ_1.zip
\_ XYZ_2.zip
\_ XYZ_3.zip


is there a way to achieve that in everything 👀??
void
Developer
Posts: 16744
Joined: Fri Oct 16, 2009 11:31 pm

Re: [help] a rename problem situation

Post by void »

Please try the Everything 1.5 advanced rename:

Search for: *.zip
(or search for: regex:^\d+\.zip$ for more control)
Select the files of interest.
Press F2.
Change the Old format to: %1
Change the New format to: $parent-name:_%1
Review the generated new filenames.
Click OK.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

How to flatten a directory structure of files into one folder.

Post by raccoon »

If you want to flatten the directory structure, renaming all the files to include their folder names, so all the files end up together into one directory...

Locate and select all of the files you wish to rename and move, then use the Edit -> Advanced -> Advanced Move To Folder... feature:

The format fields should look something like this:

Old format: E:\Media\Bob Music\Album %1\%2.mp3
New format: E:\Media\Bob Music\Album %1\%2.mp3

If you change the New format to the following, all the files will be renamed and moved into the Bob Music folder.

New format: E:\Media\Bob Music\Album %1 - %2.mp3

Getting rid of the backslash (\) and changing it to a hyphen (-) will move the files accordingly and give the files the name of the folder they used to be in. You can then check to make sure those old Album folders are empty and then delete them. This is called flattening.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: [help] a rename problem situation

Post by raccoon »

@void: There are situations the advanced move format detector will incorporate a backslash into a variable, combining the last word of a folder and the first word of the files into the same variable, and so the backslash becomes ingested and not visible in Old format/New format. Can you do something to make sure that backslashes are never ingested, making a variable appear on both sides of the backslash instead?
void
Developer
Posts: 16744
Joined: Fri Oct 16, 2009 11:31 pm

Re: [help] a rename problem situation

Post by void »

You will need to enable regular expressions and change the formulas to:

Old format: ^(.*?)\\([^\\]*)\\([^\\]*)$
New format: \1\\\2 - \3



Matching the last path part is out of scope for the simple %1 format style.
Maybe something could be done with a * and ** style format: **\*\* => $1:\$2: - $3:
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: [help] a rename problem situation

Post by raccoon »

I guess maybe we're thinking about different things. It works fine with %1 formats, if I manually assert the backslash myself. It's just that sometimes Everything will combine a part of a path-part along with part of a file's name-part into %1 instead of as %1\%2. I don't think pathparts and nameparts should ever share the same variable number, at least not in Advanced Move, as it certainly becomes confusing. There ought to be a line drawn between those two halves. Combining multiple pathparts into the same variable is fine.

I should have said that the FINAL backslash should never be ingested into a %1 variable, as it's the divider between path(s) and filename. Or am I wrong and this is useful the way it is?
Post Reply