Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

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
mark-spain
8 - Asteroid

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