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

ASF subversion and git services commented on NIFI-1258:
-------------------------------------------------------

Commit 4d88aaedc58a6aded0b5dc546469a0f9b8bf513b in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=4d88aae ]

NIFI-1258: Added a new function named getDelimitedField to the Expression 
Language and put together a guide that walks through how to add a new function

Signed-off-by: Aldrin Piri <[email protected]>


> 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