Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Output to new folder

mikirkeby
5 - Atom

Hi,

 

I have an issue with some backups. I'm reading a bunch of tables from a datebase, appending a prefix with a date stamp, and saving them individually as .csv files. Since the flow with these backups is to be run weekly, I would like it to automatically create a new folder with the date as the file name, and output the individual .csv backup files inside this folder.

 

Is this possible?

18 REPLIES 18
Paul-Evans
9 - Comet

@tazeen If there are spaces in a file path you are using, that will cause that error. Put the file path in quotes (using CharFromInt(34) if needed in a formula), and make sure your output is configured to never quote output fields.

Purpose
7 - Meteor

Tazeen,

I also run into the same issue, when my folder name had a space in it.  I was able to fix it by inserting double quotation.  

 

In my case the folder name was a field called Country in my workflow (e.g. United Kingdom). 

 

Using a formula I added a double quote to the field and created a new field [CountryInQhotes] =  ' " ' +[Country]+' " ' . 

 

I passed the CountryInQuotes to the bat file (i.e. "United Kingdom").  And if I needed to check if the folder was created, I used the Country Field.  

 

cd C:\Alteryx\Report\ mkdir "United Kingdom" || :        - works fine.  

 

 

cd C:\Alteryx\Report\ mkdir United Kingdom || :        - will actually create two folders i.e. United and Kingdom.  

Then You will run into an issue when you try to save a file into United Kingdom folder as it does not exist.  

 

Hope this helps

 

Purpose.  

 

 

Tmanuela
8 - Asteroid

Hi @SeanAdams , I am trying to set up the RUN tool with the temporary batch file. Could you please detail how to create that "blank" batch file and how to select it on "write source"/Read source as this is a .bat file and is not recognized when I browse for it (I'm not excelling at run commands 😄 )

Thank you!

Tmanuela
8 - Asteroid

Hey @Purpose ,

 

I used your recommendation and still have same error code 1 - I try to make folders for each client name and then for each fund contained as can be seen in the formula below:

Capture5.JPG 

and then I need to access those folders to output some excel files there,

The Run command tool is configured like this as recommended by @SeanAdams :

Capture4.JPG

Any ideas how can this be resolved? 

 

Many thanks!

Manuela

r4upadhye
11 - Bolide

Hi @Tmanuela 

im not sure if it works, but can you remove the double quotes for folder name & try again !

Windows don't allow folder names with "

Tmanuela
8 - Asteroid

hi @r4upadhye , thanks for your message, but still same error code 1, and It looks everything is ok or I don't realize were could be the bug..

 

Untitled.jpg

 

r4upadhye
11 - Bolide

Can you share the description of error message ?

or share the workflow ?

Tmanuela
8 - Asteroid

Hi @r4upadhye , 

 "Runme.bat retunred an error code 1"

Maybe I have a problem with my .bat file which not sure how to make a new good one. 

flow and data attached

 

thanks,

M

r4upadhye
11 - Bolide

Hi,

it seems the script will create new folders for the first time, but if we re-run then it cannot overwrite those existing folders (error code 1)

Labels