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

Parsing log text

Krish
8 - Asteroid
Hi Team,
I have a error log text like this:
File Name:xyzkey.csv
----Some texts----
record accepted :1
---some texts---
now i need to parse following
xyzkey
1(text accepted after record accepted)

Any idea.

Thanks in advance.

Regards
KRISHNA
4 REPLIES 4
jdunkerley79
ACE Emeritus
ACE Emeritus

I expect this could be done using a multi-row formula combined with some RegEx functions.

 

Could you provide a couple more example files just to make it clear on the transform you need

 

Krish
8 - Asteroid

Sample Log:

File Name is: \\Client\Apps\Loaders\Latest LOADER\Test Files\test145.csv
Records Read: 1
Records Added: 1
Records Rejected: 0
Errors Reported: 0
Warnings Reported:

 

From "File Name is: \\Client\Apps\Loaders\Latest LOADER\Test Files\test145.csv"  I want test045 alone.
Also from "Records Added:1 " , I need 1 alone

 

Thanks,

Krishna

jdunkerley79
ACE Emeritus
ACE Emeritus

The attached workflow should do what you need.

 

Select the Output file name as field option on the Input Data tool to include the file name. I chose to use a CSV mode with separator set to \0 and with field names set to 0, but there are various ways to read it in.

 

A filter expression filtering out all but the Records added row via a regular expression. And then a RegEx tool in replace mode to extract just the number

 

If you expect things other than numbers then you will need to edit the (\d+) part of the expression.

 

 Hopefully enough to get you started.

Krish
8 - Asteroid

Thanks.This Approach helped me to find the solution .

 

Labels