This cell has embedded newlines
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
It looks like my database includes some cells that have embedded newlines. I am trying to pull line items that contain "business development", and the filter function is having trouble identifying those with "business" in one line, and "development" in the next (within the same cell). I need to search for these two words together with the space in between, because otherwise i get results like "business requirements development".
Is there a way to remove these breaks within a cell in Alteryx? For example, something similar to the "Clean" function in Excel. I tried using the "Trim" function but that only seems to get rid of whitespace.
Thank you!
Solved! Go to Solution.
- Labels:
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try using the RegEx tool. You can use the Replace Method with the '\n' to search for any new line characters and replace it with ' ' (or a blank string).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You could also use a filter tool with a Regex Match formula to select there cells:
REGEX_Match([Field1], 'Business\s+Development')
The \s+ will match all whitespace (tabs, new lines, spaces) between business and development
Alternatively a formula tool like could be used to normalise all white space could be used:
REGEX_Replace([Field1], '\s+', ' ')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
alteryx will understand it. eg. Have a filter formula that says:
[field] = 'Business
Development'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! The RegEx worked by replacing it with a blank string. Everyone's comments were really helpful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I know this is old post I am replying to, not sure if you are still around in community.
I am using a crew macro to write the log to an output file, in my case, the warning is thrown but I cannot see newline in the text file. The complete log look like a big string. Do you know if there is a way to preserve newline so that while writing to file it does not ignore that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I see you got a fix with the Regex. You could also have fixed it with your data cleansing tool by selecting the option to remove linebreaks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@RodL thanks. It worked for me too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for sharing, the formula tool option worked for me.
