I have a scenario where the records are having multi-character delimiter as shown below,
1$$John Wright$$New Zealand
I need to fetch the value of the second field(John Wright).
Is there any function/processor to parse multi-character delimiter record?
Currently I am replacing the multi-character delimiter($$) with single delimiter($) using ReplaceText processor & parsing the value. Is there a better approach?
I think the easiest option is probably going to be replaceText, and then use either ExtractText, or NiFi Expression Language.
After your replaceText (fixing delimiter) processor, you could use Nifi Expression Language (getDelimitedField) and specify your new delimiter to get the exact file you need, and also trim if needed like so:
If your record contains:
1$John Wright$New Zealand
This would return "John Wright". You could also do this to trim if needed as well: