[ 
https://issues.apache.org/jira/browse/NIFI-6502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alessandro D'Armiento reassigned NIFI-6502:
-------------------------------------------

    Assignee: Alessandro D'Armiento

> Add padLeft() and padRight() functions to RecordPath 
> -----------------------------------------------------
>
>                 Key: NIFI-6502
>                 URL: https://issues.apache.org/jira/browse/NIFI-6502
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Core Framework
>    Affects Versions: 1.9.2
>            Reporter: Alessandro D'Armiento
>            Assignee: Alessandro D'Armiento
>            Priority: Minor
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> h2. Current Situation
> - [Record path 
> functions|https://nifi.apache.org/docs/nifi-docs/html/record-path-guide.html#functions]
>  don't provide anything to perform string padding
> h1. Improvement Proposal
> - Support two new recordPath functions
> -- padLeft:
> --- padLeft(string field, int desiredLength) will prepend a default character 
> to the input string until it reaches the length desiredLength
> --- padLeft(String field, int desiredLength, char c) will prepend the c 
> characters to the input string until it reaches the length n
> -- padRight:
> --- padRight(string field, int desiredLength) will append a default character 
> to the input string until it reaches the length desiredLength
> --- padRight(String field, int desiredLength, char c) will append the c 
> characters to the input string until it reaches the length n
> -- Default character should be a renderable character such as underscore
> -- If the input string is already longer than the padding length, no 
> operation should be performed 
> h3. Examples
> ----
> {
>   "name" : "john smith"
> }
> ----
> `padLeft(/name, 15, '@')` => @@@@@john smith
> `padLeft(/name, 15)` =>  _____john smith
> `padRight(/name, 15, '@')` => john smith@@@@@
> `padRight(/name, 15)`=> john smith_____



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to