community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Need to export quotes in a text string - advanced

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...

Quasar
Quasar

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

Quasar
Quasar

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.

Asteroid

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

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.

Alteryx Certified Partner
Alteryx Certified Partner

@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 reboot. Order shall return.
Asteroid

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

Highlighted
Atom

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.

Labels