Skip to content

parsing file to create folders and move

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
  • ajdazeve Offline
  • Posts: 5
  • Joined: Wed Jan 04, 2017 1:05 pm

parsing file to create folders and move

Post by ajdazeve »

Hi there,
I have a best practice question. I have files coming in looking like this
CA18670N - ACRC-All items-2017-02-17.xml
FL4686N_-_Manatee_County_School_District-Document-000000275905-000005.zip
FL4686N_-_Manatee_County_School_District.XML
Now what i am doing is grabbing the name of the file and parsing it in order to put all files belonging to a same project together
Here are the steps I am dong
Step 1: list zip files…
Go into a loop to parse folder create an move the file
The mechanic to create the folder is as follows
1: rawname1 = ${rawName:nameWithoutExtension}
2: rawNamestg = ${Replace(rawName1,'([^-]+-[^-]+)-?.*','$1')}
3: rawNamestg2 = ${Replace(rawNamestg,' ','')}
4: cleanName = ${Trim(rawNamestg2)}
I am sure there’s a way to do this without so many steps and variables. Also I create one list per type of file
.zip .xml .done
Perhaps I could make a file list and include all theses extension …
What would you suggest/