parsing filename in order to create a folder

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
1 post Page 1 of 1

ajdazeve

Posts: 5
Joined: Wed Jan 04, 2017 1:05 pm

Post by ajdazeve » Wed Jan 18, 2017 10:15 am
Hi there,
We are trying to parse a file name in order to create a folder.
The source sends to mft files like this
ID – name-All items-2017-01-17.xml
ID – name.done
And
ID – name-Document-000000008084-000001.zip

Now I need the zips and xml files with the same ‘name’ to go in the same folder.
Currently I run 4 different steps
List files…. > raw name
Take rawname…. Name withoutextension…. == var1
Take var1 and remove and symbols and date
Then with another variable I remove the spaces each side of the first dash….

The problem is sometimes my final variable name contains a empty space I tried to add the trim function but doesn’t work
Is there a better way to do this?
For example ..
Step one remove all extension
${rawName:nameWithoutExtension}
Step 2 would be ….. remove anything after the second dash and any whitespace
1 post Page 1 of 1