Alteryx Designer Desktop Discussions

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

Removing only first line break in the field

TS2895
5 - Atom

Hi Alteryx community,

 

The data in the field is separated by line breaks as following:

 

Test data 1

Test 2

Test 3

Test 4

 

However, in some of the rows, there is a line break before the data.

 

Line break 

Test data 1

Test 2

Test 3

Test 4

 

Only in such cases, I want to remove the first line break and keep the subsequent ones. Is there a way I can do it. Regex_replace is removing all the line breaks which does not work for me.

 

Thanks,

3 REPLIES 3
gabrielvilella
14 - Magnetar

Hi @TS2895, you can try this RegEx expression:

(\w+.+)

 

IraWatt
17 - Castor
17 - Castor

Hey @TS2895,

Another option is to use the data cleansing tool with this setting:

IraWatt_0-1658681399566.png
Ira Watt
Technical Consultant
Watt@Bulien.com 

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@TS2895 ,

 

regex_replace([field],"(.*)?[\n\r](.*)",'$1 $2')

 

i replace the first new line or carriage return with a space.  

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels