You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by "Mark Payne (JIRA)" <ji...@apache.org> on 2015/12/14 14:46:46 UTC
[jira] [Updated] (NIFI-1258) Add getDelimitedField method to
Expression Language
[ https://issues.apache.org/jira/browse/NIFI-1258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Payne updated NIFI-1258:
-----------------------------
Attachment: 0001-NIFI-1258-Added-a-new-function-named-getDelimitedFie.patch
> 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
> 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)