Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to add empty spaces after word into a 20 characters field?

Joker_Hazard
11 - Bolide

Hi all!

 

I have a TXT template in which I need to substitute "NNNNNNNNNNNNNNNNNNNN" for the name of cities, respecting empty spaces. 

 

So for example:

 

New YorkNNNNNNNNNNNNNNNNNNNN

 

Bold where the word is and not bold the empty spaces. 

 

Another example:

 

Philadelphia NNNNNNNNNNNNNNNNNNNN

 

Unfortunately, when I create the automation. the empty spaces that were not used are deleted from the file. My system only reads line with 241 positions on a TXT, so I need those empty spaces in there to fill the field "City" that I added "N's"

 

Very tough to explain, hope someone can enlighten me on this, it's been a few days I'm stuck on this.

 

I am adding one wrong output and the correct one, how it should be!

 

Thanks

 

2 REPLIES 2
Spainey
9 - Comet

Hi @Joker_Hazard

I think the issue is with your PadRight() function. It is the correct function to use, but the syntax is slightly wrong. 

PadRight([City 20 characters], 20, '')

should be replaced with 

PadRight([City 20 characters], 20, ' ') // Pad with a space character
Joker_Hazard
11 - Bolide

How can I be so blind! Thank you very much Mark, some times we need to look at the small details

Labels
Top Solution Authors