Alteryx Designer Desktop Discussions

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

Need to export quotes in a text string - advanced

ColleenH218
8 - Asteroid

I've seen posts (like this one: https://community.alteryx.com/t5/Data-Preparation-Blending/Use-Special-character-in-Formula-tool/td-...) that suggest that in order to retain or export quotation marks as part of a text string, you precede them with a single quote. (So to get "AAA" you use '"AAA"' in your formula.) Only in my instance, I'm attempting to create dynamic content to be written to a batch file, and I need to parse a field name into the string. The juxtaposition of the field name within the quotes I'm commenting seem to be what's causing me problems. Has anyone done this before? What I'm attempting to write to the batch file is this:

 

move /y \\filepath\data\public\folder\Rebates_Processing\UploadClaims\*ABC*.xlsx "\\filepath\data\public\folder\Rebates_Processing\Folder1\[Passthru Value]\ARCHIVE"

 

The quotes are needed around the second path so as to handle instances where the passthru value has spaces in it.

 

The workflow successfully writes content to the batch file, but there seem to be extra quotes around some of the values which cause it to fail.

 

In my formula, I've used MANY iterations with slightly different quotes, but I'm thinking it should be something like this:

 

"move /y \\filepath\data\public\folder\Rebates_Processing\UploadClaims\*ABC*.xlsx '"\\filepath\data\public\folder\Rebates_Processing\Folder1\"+[Passthru Value]+"\ARCHIVE"'"

 

Has anyone successfully done this? I'd appreciate any feedback or suggestions! (This is such a complex workflow that to have it fail on something so small as a quotation mark is infuriating! :) )

 

Thanks...

9 REPLIES 9
Treyson
13 - Pulsar
13 - Pulsar

Hello @ColleenH218,

 

Instead of trying to create a string, could we just have this string existing and do a find and replace? I have an example attached (which I apparently can't spell "Find")

 

Treyson

Treyson Marks
Senior Analytics Engineer
Treyson
13 - Pulsar
13 - Pulsar

You could also use a text input tool to have the 1st and 3rd part of your formula pre-populated and then you could just add them together without quotes. See attached.

Treyson Marks
Senior Analytics Engineer
ColleenH218
8 - Asteroid

I tried the find/replace...I still ended up with more quotes than were needed. Off to try your second suggestion though!

ColleenH218
8 - Asteroid

@Treyson - I downloaded your sample and the difference between what you've suggested and what I previously tried seems to be feeding the string values through from an input source rather than from within a formula. (I'd previously tried the latter.)

 

Here's my configuration of my input:

 

TextInput.jpg

 

And my formula piecing it together:

formula.jpg

 

And what it produces in my .bat file, which still fails (error code 1):

 

batchfile.jpg

 

It seems to want to wrap the entire thing into quotes, and double the quotes I intend to have in place.

MarqueeCrew
20 - Arcturus
20 - Arcturus

@ColleenH218,

 

I'm going to skip the insertion of quotes and get to the answer.

 

\0

When you are writing your .bat as a .csv file, Alteryx wants to put quotes around your string.  If you change the delimiter to \0 (Null), it won't do that.  I'm sorry to hear that you spent a long time on this.  I don't know when or where I came across it in my past, but now the torch has been passed and you are the holder of this cup of knowledge.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
ColleenH218
8 - Asteroid

@MarqueeCrew You're the master! Thank you SO MUCH!

Jake_NG
7 - Meteor

This helped for me.. I am able to specify an output directory with spaces following this format:

 

'mkdir c:\folder\"folder with spaces"\' and then in the Run command opening up the Output settings for Write Source and entering \0 in the "delimeters" field, if that was unclear for anyone.

JTCairns
8 - Asteroid

And thus the future of the Alteryx people was secured. From user to user the cup of knowledge was passed.

JTCairns_0-1576685539161.png

SFTakach
5 - Atom

Thanks for this solution. I had been attemping various options, have been searching for this for a while, and have been growing increasingly frustrated by not being able to locate a solution. I should have realized. The character \0 is the ASCII character code for NULL. Thanks.

Labels