Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-1258

Add getDelimitedField method to Expression Language

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5.0
    • Component/s: Extensions
    • Labels:
      None

      Description

      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:

      1,84,Mark,555-555-5555,123 My Street,"My City, MS"
      

      We should be able to reference the city & state and capitalize it by using:

      ${line:getDelimitedField(6):toUpper()}
      

      Similarly, if we have:

      1|84|Mark|555-555-5555|123 My Street|My City, MS
      

      We should use:

      ${line:getDelimitedField(6, '|'):toUpper()}
      

      Finally, we should be able to specify an enclosing string so that if we have:

      1,84,Mark,555-555-5555,123 My Street, __My City, MS__
      

      We can access it via:

      ${line:getDelimitedField(6, '|', '__'):toUpper()}
      

        Attachments

          Activity

            People

            • Assignee:
              markap14 Mark Payne
              Reporter:
              markap14 Mark Payne
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: