move folder in folder of same name SOLVED

Off-topic posts of interest to the "Everything" community.
Post Reply
kazzybash
Posts: 98
Joined: Mon Mar 02, 2020 9:55 pm

move folder in folder of same name SOLVED

Post by kazzybash »

hi, on my laptop I have quite a number of folders that each only contain a folder with the exact same name as the folder they are in. The deepest folder contains files I want. Is there software to move those deepest folders up one level and/or does anyone know how to script this? Thanks for reading! kazzy
Last edited by kazzybash on Thu Feb 22, 2024 10:07 am, edited 1 time in total.
void
Developer
Posts: 15353
Joined: Fri Oct 16, 2009 11:31 pm

Re: move folder in folder of same name

Post by void »

To move the folders up in Everything 1.5:
  • Search for:
    "c:\some\path\to\folders\" folder: $name:==$parentname:
  • Select the folders of interest.
  • From the Edit menu, under the Advanced submenu, click Advanced Move to folder.
  • Check Regular expressions.
  • Change the Old format to: ^(.*)\\([^\\]*)$
  • Change the New format to: \1
  • Review the new filenames and click OK.
  • Accept the prompts to replace the folders.
kazzybash
Posts: 98
Joined: Mon Mar 02, 2020 9:55 pm

Re: move folder in folder of same name

Post by kazzybash »

:idea: This works, phenomenal... I haven't figured out how to make lasagna with Everything, but I a think it will be able to do even that.

Just one last step in this thread...

I only want to move nested folders with the same name when the parentfolder does not have any other files or folders in it.

How should the search command be configured to do this?

thanks a lot again...
void
Developer
Posts: 15353
Joined: Fri Oct 16, 2009 11:31 pm

Re: move folder in folder of same name

Post by void »

folder: $name:==$parentname: sibling-count:0

$name:==$parentname:
sibling-count:
kazzybash
Posts: 98
Joined: Mon Mar 02, 2020 9:55 pm

Re: move folder in folder of same name

Post by kazzybash »

thanks void!!
Post Reply