Parse all Errors from Log - RegEx
- 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
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
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
