Move and sort files into existing folders based on first 2 characters

Hello,

Just starting a few months ago with opus and love it.
Already have buttons to select some duplicate files based on extension works great.

Now I want to automatically move and sort files into right folder and only move the file if there isn't a file or it's newer than already is in the folder.
question pop up for selecting keep newer etc. is also fine

I found this but it's not working like I want.
button to move files

here is situation.
In a folder I have files like this
09xxxx.type
13xxxx.type
24xxxx.type
etc.

These files need to move into a folder.
This folder have 35 subfolders and all of them begins with the 2 numbers
01xxxx some text
02xxxx some text
...
26xxxx some text

So I like to have a button or I see you can do something with rename?
To select all files and with the push button to move and sort the files

If the destination folders' text after the numbers isn't the same as in the files, you'd need to use scripting to do that, since it would have to list the main destination folder and work out which sub-folder to put things in.

So it's not impossible, but not trivial either. We can help more if you link your account.

Forgot to link my account.. it's linked now.

1 Like

A quick and dirty solution would be to have a button with 35 Copy commands like this:

Copy MOVE HERE WHENEXISTS=keepnewer FILE=01*.* CREATEFOLDER="01xxxx some text"
Copy MOVE HERE WHENEXISTS=keepnewer FILE=02*.* CREATEFOLDER="02xxxx some text"
...

Easily created with any text editor.

2 Likes

But the CREATEFOLDER command doesn't create a folder if the folder name already exist?

Correct.

1 Like

Thanks that is working now.
Final question because I struggle a little bit to get a fixed location working.

There is also a Copy TO=/mydestfolder command.

But how should it look like when you want to copy the files to
E:\temp\mydestination
?
tried something like this and then the location or drive letter but it's not working because I don't know the syntax of it

Copy MOVE TO=/ ????  WHENEXISTS=keepnewer FILE=01*.* CREATEFOLDER="01xxxx some text"

Just use

TO=E:\temp\mydestination
1 Like

The example is working thanks
The reason it did not work for me is because I have a folder with 3 words separate with spaces
so I did some testing

working

TO=E:\temp
or
TO=E:\temp\test

not working

TO=E:\temp space temp

Paths with spaces need to be in quotes.

TO="E:\temp space temp"
1 Like

That is the trick!

Thank you all for the support!
this is helping me allot with the workflow

1 Like