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

Parse all Errors from Log - RegEx

flipperdm
8 - Asteroid

Hi,

I'm using the "running tool" to for my workflows.  User Regex, I'd like to parse each of the lines that start with "Error" from the log but I don't know how to do that dynamically.  So, if I use the "Regular Expression":

 

(Error.*)

 

...I will return the first line that starts with error but if there are more than 1 errors, my "regular expression" has to match the exact number of errors or it won't parse the information correctly.

 

So if I have 2 errors and I put my RE as:

(Error.*)(Error.*)(Error.*)

 

No errors will be found or parsed.

 

Help,

Mark

 

3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus

Consider stepping back from the problem and thinking a bit simpler, that's what I like to do!

 

In this instance Instead of building a regex statement which I can't do, I can think of an alternative way to do this. What about the text to columns tool, this allows me to split to rows.

 

Okay, but the text to columns tool only accepts a single delimter character so I can't use 'Error'.

 

Lets start by replacing "Error" with "|Error"

 

Then we can split on |

 

Then remove the word Error from the start of the string.

 

Example attached.

 

Ben

jasperlch
12 - Quasar

Hi @flipperdm,

 

This can be achieved by using the Tokenize methods in the Regex tool:

 

Capture1.PNG

flipperdm
8 - Asteroid

Hi, Thanks for the suggestion.  This method works well when reading a file that has been saved, the tool doesn't work as well when directly reading from an error from the "runner" macro (CReW Macros).  I will still use this for some other applications.

Labels