Quantcast
Channel: Data Preparation & Blending discussions
Viewing all articles
Browse latest Browse all 4999

Regex_Replace to remove carriage return + line feed

$
0
0

I'm trying to remove carriage return+line feeds using the REGEX_Replace function in the formula tool.  In the screenshot below I have a simple test pipe delimited file with two fields, Description and Attempt, shown in Notepad ++ with the 'Show all characters' options selected so the carriage return+line feeds are visible.

Alteryx REGEX_01.png

I'm using the following REGEX_Replace function in the 'Description' field of my test file in order to test removing the extra Carriage Return+Line Feed showing in Line 4 of my test file:  REGEX_Replace(Description, "\r*\n*", "")

I took this tip from the following link:

https://community.alteryx.com/t5/Data-Preparation-Blending/Remove-new-line-characters/td-p/8053

For the output I'm wanting to end up with my header and four output rows of data because in my test scenario, rows 4 and 5 are really one row.

When I run my simple test and browse the results, the extra Carriage Return+Line Feed remains.  I've been playing around with this and cannot get it to work.

Below is a screenshot showing the results:

Alteryx REGEX_02.png

REGEX is new to me so I have a feeling I'm missing something basic.  Any insight is appreciated!

 

Stuart


Viewing all articles
Browse latest Browse all 4999

Trending Articles