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

Alteryx designer Discussions

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

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More
SOLVED

Remove new line characters

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.

 

Alteryx Certified Partner
Alteryx Certified Partner
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

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

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?

can you post some sample of your data struture 

Alteryx Certified Partner
Alteryx Certified Partner

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

 

Best regards,

Daniel

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?

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

Atom

That works!

 

Thank you.

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