One Star

tFileInputRegex - processing lines where pattern does not match

I have a complex log file for which I use regex to separate parts of the log lines into separate fields:
<GREEN>You conjure a ring that glistens.
<GREEN>An aura of levity emanates from your ring.
You cast <highlight>Planar Gateway</color> on yourself.
You cast <highlight>Conjure Quicksilver Ring</color> on yourself.
<GREEN>You conjure a ring that flows.
<GREEN>A mercurial aura emanates from your ring.
Just as an example, I use (without additional JAVA escape characters):
\]+)] (.+) cast <+>(.+)<+> on (.+)\.
To get:
1=?19:59:53? 2=?You? 3=?Planar Gateway? 4=?yourself?
I thought the tFileInputRegex ?rejected? output stream would have all the rows which does not match the pattern but it seems I?m wrong. The rejected stream is empty.
Is this intended or am I doing something wrong that I don?t see any row in the rejected output stream?
3 REPLIES
Community Manager

Re: tFileInputRegex - processing lines where pattern does not match

Hi
I thought the tFileInputRegex ?rejected? output stream would have all the rows which does not match the pattern but it seems I?m wrong. The rejected stream is empty.

Because tFileInputRegex read the rows which does not match the pattern and get nothing, so the values of schema are null and the rejected stream is empty.
see some codeSmiley Sadrow1 is main flow and row2 is reject flow)
	} catch (Exception e) {
whetherReject_tFileInputRegex_1 = true;
row2 = new row2Struct();
row2.id = row1.id;
row2.name = row1.name;
row2.errorMessage = e.getMessage();
row1 = null;
}

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tFileInputRegex - processing lines where pattern does not match

Ok. I understand.
Is there a chance that with future versions this component could have an additional output stream with not matching rows?
Community Manager

Re: tFileInputRegex - processing lines where pattern does not match

Hi
Is there a chance that with future versions this component could have an additional output stream with not matching rows?

Yes, you can report a new feature on our bugtracker.
Thanks for your support!
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business