#1 2021-02-09 17:39

ariah
Member
Registered: 2021-02-09
Posts: 3

How can I move files to a folder upwards in the file tree?

I love the ability to create subfolders using functions like Rearrange, but how would I move a file or folder to a HIGHER folder in the directory tree?

For instance, I have this:

C:\files\unique folder 1020\subfolder\targetfolder\

How would I move that to this, the same directory as its current subfolder?

C:\files\unique folder 1020\targetfolder\

I have a large number of unique folders, and some have the target folder, and some do not.

Last edited by ariah (2021-02-09 17:41)

Offline

#2 2021-02-09 17:50

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: How can I move files to a folder upwards in the file tree?

You can insert either an absolute or a relative path into the new name, and both will be resolved appropriately.

To move things up the directory hierarchy in a relative fashion, simply prefix your names with "..\" or several times that for each directory level.

See also: ReNamer:Renaming_to_another_folder.

Offline

#3 2021-02-09 18:44

ariah
Member
Registered: 2021-02-09
Posts: 3

Re: How can I move files to a folder upwards in the file tree?

Thank you!

I hope you don't mind if I ask another related question in the same thread.

Part of what I'm trying to do is move files and folders that begin with exactly four digits. If I use [0-9][0-9][0-9][0-9] as a mask, it just identifies anything that begins with a number, and disregards the number of digits. What is the proper mask for that? Is it possible?

Offline

#4 2021-02-10 00:11

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: How can I move files to a folder upwards in the file tree?

ariah wrote:

Part of what I'm trying to do is move files and folders that begin with exactly four digits. If I use [0-9][0-9][0-9][0-9] as a mask, it just identifies anything that begins with a number, and disregards the number of digits. What is the proper mask for that? Is it possible?

Where exactly are you using this mask? In a rule or the filter settings or somewhere else?

You could do this with a single Regular Expressions rule, with the following rule configuration:

> Replace expression "\A(\d{4})\b" with "..\\$1" (skip extension)

Offline

#5 2021-02-10 03:26

ariah
Member
Registered: 2021-02-09
Posts: 3

Re: How can I move files to a folder upwards in the file tree?

That worked perfectly, thank you! I think I will use RegEx more often.

I was trying to use that [0-9][0-9][0-9][0-9] pattern in Rearrange and Replace rules.

Offline

Board footer

Powered by FluxBB