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

Alteryx designer Discussions

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

Parse all Errors from Log - RegEx

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

 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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

Quasar

Hi @flipperdm,

 

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

 

Capture1.PNG

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