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

Remove new line characters

Echo
5 - Atom

Hi all,

 

I am trying to remove new line characters present in the data.

Currently we are using the "formula" macro and input Regex_Replace([FIELD], "\r*\n*", "") for each and every field.

 

When working with 100+ columns it becomes very cumbersome.

Is there a way to remove new line characters in one go from all columns?

 

Thanks.

 

13 REPLIES 13
danielbrun2
ACE Emeritus
ACE Emeritus
Hi,

I would consider to transpose all the columns and then remove it from the
data column. After removing new line chars you can then crosstab the data
back to normal. To transpose data you can watch this video.

https://vimeo.com/146105160

Best regards,
Daniel

--
Daniel Brun
+45 21 25 61 20 <++45+21+25+61+20>



a.Flæsketorvet 68, 1711 København Ve.daniel@inviso.dkt.@DanielPBrun
l.linkedin.com/in/danielbrunw.inviso.dk
Prøv Tableaueller Alteryxgratis i dag
s_pichaipillai
12 - Quasar

Echo,

try with "Multi-Field Formula" tool, then choose the fileds you want to remove new lines something like this  Regex_Replace( [_CurrentField_], "\r*\n*", "")

i hope this way you can apply the same logic for multiple fileds in one go

Echo
5 - Atom

Hidanielbrun,

 

Thanks for your reply.

 

The problem is that new line characters are present in the headers as well as the data.

So transposing won't help.

 

Any other suggestions?

s_pichaipillai
12 - Quasar

can you post some sample of your data struture 

danielbrun2
ACE Emeritus
ACE Emeritus

You could also Regex the field names after transposing. Please post some sample data, if you are able to.

 

Best regards,

Daniel

Echo
5 - Atom

Hi

 

In the "Multi-Field Formula" tool, what syntax do we use to select all fields in the expression box??  

 

Regex_Replace( [_ALLField_], "\r*\n*", "")

 

What do we use in place of ALLFIELDS?

s_pichaipillai
12 - Quasar

In multi filed toold-->configuration --> select the "text" fileds as you have the New lines in string fileds

it will display all the string fileds then click on All

in the exp, Please the " Regex_Replace( [_CurrentField_], "\r*\n*", "")"

where _CurrentField_ is for all selected string fileds

 

Refer the below image 

Multi.PNG

Echo
5 - Atom

That works!

 

Thank you.

Sheila29
7 - Meteor

Hi,

 

Your solution looks like it could work for my problem. However, in my multi-formua tool, it is already truncating my data. Please see attached screen shots. Can you let me know where I'm going wrong here please?

Labels