Export via Batch processor with saving directory structure

Started by Cobblestone-TLT, May 12, 2019, 09:00:15 PM

Previous topic - Next topic

Cobblestone-TLT

Hello!
Which option should I use in "Output folder" setting in "Batch processor" if I want export my files with their directory structure in "out of database" folder.

For example, I keep my master files with following structure:

D:\
D:\Photo\
D:\Photo\2017\
D:\Photo\2017\2017-01-02 16-35-06.jpg
D:\Photo\2017\2017-07-16 14-54-04.jpg
D:\Photo\2018\
D:\Photo\2018\2018-01-20 10-20-34.jpg
D:\Photo\2018\2018-10-07 16-58-07.jpg
D:\Photo\2018\Summer vacation in Praha\
D:\Photo\2018\Summer vacation in Praha\2018-07-01 11-20-22.jpg
D:\Photo\2018\Summer vacation in Praha\2018-07-02 22-43-16.jpg

After export I want to get completely the same structure, but in different 'root' folder out of my database, for example:

E:\
E:\Photo4share\
E:\Photo4share\2017\
E:\Photo4share\2017\2017-01-02 16-35-06.jpg
E:\Photo4share\2017\2017-07-16 14-54-04.jpg
E:\Photo4share\2018\
E:\Photo4share\2018\2018-01-20 10-20-34.jpg
E:\Photo4share\2018\2018-10-07 16-58-07.jpg
E:\Photo4share\2018\Summer vacation in Praha\
E:\Photo4share\2018\Summer vacation in Praha\2018-07-01 11-20-22.jpg
E:\Photo4share\2018\Summer vacation in Praha\2018-07-02 22-43-16.jpg

But if I use in "Output folder" setting string like "E:\Photo4share\{d0}", as result I have following structure:

E:\
E:\Photo4share\
E:\Photo4share\2017\
E:\Photo4share\2017\2017-01-02 16-35-06.jpg
E:\Photo4share\2017\2017-07-16 14-54-04.jpg
E:\Photo4share\2018\
E:\Photo4share\2018\2018-01-20 10-20-34.jpg
E:\Photo4share\2018\2018-10-07 16-58-07.jpg
E:\Photo4share\Summer vacation in Praha\
E:\Photo4share\Summer vacation in Praha\2018-07-01 11-20-22.jpg
E:\Photo4share\Summer vacation in Praha\2018-07-02 22-43-16.jpg

I tried to use string like "E:\Photo4share\{d1}\{d0}", and after that manually move upper subdirectories from folder "Photo" in my output directory, but it is not useful for me, because sometimes I use more difficult structure for my files, like:

D:\Photo\2018\Summer vacation in Praha\
D:\Photo\2018\Summer vacation in Praha\2018-07-01 11-20-22.jpg
D:\Photo\2018\Summer vacation in Praha\2018-07-02 22-43-16.jpg
D:\Photo\2018\Summer vacation in Praha\The castle Hluboka nad Vltavou\
D:\Photo\2018\Summer vacation in Praha\The castle Hluboka nad Vltavou\2018-07-03 12-07-44.jpg
D:\Photo\2018\Summer vacation in Praha\The castle Hluboka nad Vltavou\2018-07-03 13-21-52.jpg

And in this case string "E:\Photo4share\{d2}\{d1}\{d0}" is not suitable yet.

I want to use a universal preset to export any file from my "master" folder to folder "for share", how can I keep whole structure of subdirectories in output folder regardless of the depth of input directory nesting?

Maybe there is a key to cutting off part of the path from the beginning, not from the end, like it do {p1}, {p2}...?



Mario

Maybe use the original path and a replace function to replace parts of the path?
You can quickly try out in VarToy.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Cobblestone-TLT

#2
Quote from: Mario on May 12, 2019, 09:08:20 PM
Maybe use the original path and a replace function to replace parts of the path?
You can quickly try out in VarToy.

Yes, it sounds perfect, but how can I replace "D:\Photo" to "E:\Photo4share" in "Output folder" string in Batch processor? Can you explain in more detail, may be give an example? I can't find anything in "IMatch Help System" about "VarToy".

Added:

I found VarToy in app manager panel, but I absolutely do not understand how to replace text in a variable {File.FullName}, and how I can use this app to resolve my problem.

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Cobblestone-TLT

Perfect! That's what I need! The 'Output folder' string in my case is "{File.Path|replace:D:\Photo==E:\Photo4share}"

Thank you so much!  ;)

Mario

You're welcome.

IMatch is indeed powerful and there is usually a solution, even for uncommon requirements. Spread the word. Let others know about IMatch  :)
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook