How to avoid duplicate folder names when Moving in Renamer

Started by Mogli, April 07, 2021, 05:40:58 PM

Previous topic - Next topic

Mogli

Most of my files are in subfolders using YYYY-MM-DD structure.  I have some files with various create dates dumped into folders without this structure (e.g., Miscellaneous folder).

Using the Copy/Move function in Renamer tool, my destination folder is set as:
J:\Pictures\{File.DateTime|format:YYYY-MM-DD}

Example:
Source file:
J:\Pictures\Vienna Pics\IMG_0721.MOV

Destination file:
J:\Pictures\2010-09-11\IMG_0721.MOV

This has worked creating a new YYYY-MM-DD subfolder and moving the files on a small sample.  HOWEVER, if there is already a subfolder called "2010-09-11", the Remamer will create a second subfolder called "2010-09-11(1)" instead of putting into the existing subfolder if one exists.

I do not understand the {p0} and {d0} functions described in the iMatch help system.

So how do I tell Renamer to use an existing date folder if one already exists, but create a new one if it does not exist?

Thanks!




Mario

This does usually not happen. Folder names with a (n) appended are produced by Windows Explorer, not IMatch.

Is the target folder in the database already or do you allow the Renamer to add the folder?

I have renamed/moved 20 files in several batches. The files go into folders 2021-02-01, 2021-02-02, 2021-02-03, 2021-02-04.
I ran the Renamer four times. None of the output folders was duplicated, and all files where moved.

The {p} and {d} tokens allow you to refer to the path or parts of the path of the file.
See, for example, this example: Folders based on Year/Month
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mogli

OK so first of all, the foldername(1) was my dumb fault!  The (1) is the file count.


I ran the move function for file #1 dated 2010-09-11, with "Add created folders to database" set to yes, all. It created the first folder.

I ran the move function for file #2 dated 2010-09-11, with "Add created folders to database" set to yes, all. It created the second identical folder.

Then I read the help section better.  I ran the move function for file #3 dated 2010-09-11, with "Add created folders to database" set to Bottom level only. It went into the first folder as desired without creating a new folder.

The result is that all three files show in both folders in the Media and Folders pane.  In Windows Explorer there is just one folder for that date that has all three files.

I know how to do it correctly now:  select Bottom level only.  If this entire post will just confuse people, feel free to delete it.


Mario

This option has nothing to do with how the Renamer creates folders.
It controls if you want to include only the bottom level folder created in your database (rarely useful) or the entire path (every folder along the path not already in the database) (most frequent case).
Only when you definitely know that the target folder is already in the database or you explicitly want to move the files outside of IMatch (warning) you should keep this option off.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mogli

I assume you mean one should typically keep the "yes, all" option off?  If so, The Renamer should not set "yes, all" as the default on first use.

Thanks for your help.  I was able to move around hundreds of files in seconds.

From the help page:

"The option to add all levels to the database can add many folders to your database, e.g. when you move a file to another disk. If you instruct IMatch to add all levels, it will add all folders, starting at the root folder. Usually adding only the bottom level (the folder to which the file is moved/copied) is the right choice."

Mario

"Yes, all" is the default.
Only when the user explicitly wants to only add the leaf-level folder or even move the files out of the database, the default should be changed.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook