How to slice and dice the {directory} token

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

DoubleD
Posts: 80
Joined: Mon Jul 06, 2015 3:40 pm

How to slice and dice the {directory} token

Post by DoubleD »

I have some long paths
C--Users-Pictures-~ MAC & USBANDS-~ MAC-2024-2024-03-23 Norwalk High School-01 Arlington Cadet Winter Guard-

I already use {Folder name[1-2]}_{EXIF:Date Taken [Y-m-d]}_ for the begining of the output file

I'd like to grab just the back end of the directory using a subset of {directory[?-?]} as in "01 Arlington Cadet Winter Guard" but I'm not sure how to strip it out

so it seems that this may do it - correct me if I am wrong -{Folder name[0-0]}
The whole string being {Folder name[1-2]}_{EXIF:Date Taken [Y-m-d]}_ MAC@Norwalk-High-School~{Folder name[0-0]}_###


It might be asking a lot but can I also replace the spaces in the name from spaces to _ or -


P.S. change request maybe - Could I use some of these variables in the output folder say {directory}\Adjusted


Any assistance is appreciated
DoubleD
Posts: 80
Joined: Mon Jul 06, 2015 3:40 pm

Re: How to slice and dice the {directory} token

Post by DoubleD »

Yes this will do it. Take the last portion of the destination folder name

{Folder name[1-2]}_{EXIF:Date Taken [Y-m-d]}_ MAC@Norwalk-High-School~{Folder name[0-0]}_###


I didn't get a reply as to changing spaces to hyphens so I renamed the directories without spaces

Hope I get an answer as to if I can use variables in the destination folder
User avatar
xnview
Author of XnView
Posts: 45553
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: How to slice and dice the {directory} token

Post by xnview »

do you have tried {Folder name [-?]}
Pierre.
DoubleD
Posts: 80
Joined: Mon Jul 06, 2015 3:40 pm

Re: How to slice and dice the {directory} token

Post by DoubleD »

xnview wrote: Tue Apr 02, 2024 12:18 pm do you have tried {Folder name [-?]}
I didn't try that but I did do this {Folder name[0-0]} and it seems to have worked but I'm getting the filling I may be wrong
DoubleD
Posts: 80
Joined: Mon Jul 06, 2015 3:40 pm

Re: How to slice and dice the {directory} token

Post by DoubleD »

xnview wrote: Tue Apr 02, 2024 12:18 pm do you have tried {Folder name [-?]}


This worked


{Folder name[1-2]}_{EXIF:Date Taken [Y-m-d]}_ USBands@Bethel-High-School~{Folder name[4-]}-###