[ 
https://issues.apache.org/jira/browse/NIFI-1258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15062446#comment-15062446
 ] 

Oleg Zhurakousky commented on NIFI-1258:
----------------------------------------

I see things like this 
{code}
if (index < 1) {
+            return new StringQueryResult("");
+        }
{code}
Just curious, what would cause the index to be negative and why is it 
considered to be an OK condition and not exception? If anything, shouldn't this 
be fixed in Evaluator?

> Add getDelimitedField method to Expression Language
> ---------------------------------------------------
>
>                 Key: NIFI-1258
>                 URL: https://issues.apache.org/jira/browse/NIFI-1258
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>             Fix For: 0.5.0
>
>         Attachments: 
> 0001-NIFI-1258-Added-a-new-function-named-getDelimitedFie.patch
>
>
> With the ability for Processors to use arbitrary variables in the Expression 
> Language, based on what a Processor provides, a powerful feature would be to 
> reference a specific field in delimited text data. For example, this can be 
> used with RouteText to very effectively route CSV (or tab-delimited, or any 
> other type of delimited text) data.
> If we have the following line:
> {code}
> 1,84,Mark,555-555-5555,123 My Street,"My City, MS"
> {code}
> We should be able to reference the city & state and capitalize it by using:
> {code}
> ${line:getDelimitedField(6):toUpper()}
> {code}
> Similarly, if we have:
> {code}
> 1|84|Mark|555-555-5555|123 My Street|My City, MS
> {code}
> We should use:
> {code}
> ${line:getDelimitedField(6, '|'):toUpper()}
> {code}
> Finally, we should be able to specify an enclosing string so that if we have:
> {code}
> 1,84,Mark,555-555-5555,123 My Street, __My City, MS__
> {code}
> We can access it via:
> {code}
> ${line:getDelimitedField(6, '|', '__'):toUpper()}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to