Chandru, This ticket has now been merged to master. This feature will be available in 0.4.0, which should be out next week. If you prefer to build from source, it is now available for use from master. You should be able to now configure ReplaceText to easily replace the values: |
Here, we use the Search value of (.*?),(.*?),(\d+.*) So the first Capturing Group gets the first column, the second Capturing Group gets the second column, and the third Capturing Group gets the third column (but only if it starts with a digit, so this won't match the header line and the header line will remain unchanged). For the Replacement Value, we use: $1,$2,${ '$3':toDate( 'ddMMMyyyy'):format('yyyy/MM/dd') } So here we are using back references to replace the line with the first two columns, followed by an _expression_ Language _expression_ that parses the third back reference (the third column). Since the variable that we want to reference is named $3, we need to enclose it in quotes to escape the name because it begins with a non-alpha character. We can then call any _expression_ Language _expression_ that we want. So toDate() can be used to parse the string as Date and then we can use format() to format that date as a string in a different format. You can also see the template available on the NIFI-1249 ticket, also attached for convenience here, but I don't know if the apache mailing list will let the template through. This was a great addition to NiFi that I think will help out in a lot of cases - thanks for reaching out to us on this! Please let us know if you have issues getting this to work, or if you have any further questions. We're happy to help however we can. Thanks -Mark |
NIFI-1249.xml
Description: XML document
|
