Hi,

Because this seems to be a more complex mapping, using ExecuteScript with 
Groovy (or another supported scripting language if you’re more comfortable with 
one) to do the translation may make sense. Matt Burgess has provided detailed 
tutorials in a variety of languages on his blog [1]. Performing JSON 
translation and regex operations in the scripting language should be pretty 
straightforward. This might be a faster solution than trying to modify 
ReplaceTextWithMapping or writing a new processor from scratch.

If you need help writing the script to do the translation, we can try to put 
something together, but may need more sample data to ensure we understand your 
expectations correctly. Hope this helps.

[1] 
http://funnifi.blogspot.com/2016/02/executescript-json-to-json-conversion.html 
<http://funnifi.blogspot.com/2016/02/executescript-json-to-json-conversion.html>


Andy LoPresto
[email protected]
[email protected]
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On May 16, 2016, at 1:42 PM, idioma <[email protected]> wrote:
> 
> Joe, thanks for your reply. I wonder whether a typo in my example might have
> made what I would like to achieve slightly confusing. My mapping file looks
> like this (note value in bold as opposed to "2" as included in my first
> post":
> 
> Header1;Header2;Header3
> A;some text;*A2 *
> 
> Am I correct in saying that ReplaceTextWithMapping does not allow multiple
> matching groups? The main problem, also, seems to come from the fact that my
> input Json has different keys, but same values:
> 
> {"field1" : "A",
> "field2" : "A",
> "field3": "A"
> }
> 
> I am not sure how to go about it, if ReplaceTextWithMapping is not the ideal
> solution.
> 
> Any further suggestion/recommendation is much appreciated.
> 
> Thank you,
> 
> I.
> 
> 
> 
> --
> View this message in context: 
> http://apache-nifi-developer-list.39713.n7.nabble.com/Help-with-ReplaceTextWithMapping-processor-multi-column-mappings-tp10280p10338.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to