Created 08-22-2016 10:44 AM
I have splited data json like this:
{"id":"TSO31101","year":"1992","name":"SDN","npsn":"20211628"}
I want to replace "SDN" and "TSO31101" contents using processor ReplaceTextWithMapping
my mapping file content like this:
SDN<tab>SD
TSO31101<tab>AAAA
how it is work?
Created 08-22-2016 01:03 PM
I not sure ReplaceWithMapping is powerful enough ...
I would anyhow prefer a solution like this (look at the edited answer at the bottom):
You have more control which values of which keys you actually replace and you can replace multiple values in one record
Created 08-22-2016 01:03 PM
I not sure ReplaceWithMapping is powerful enough ...
I would anyhow prefer a solution like this (look at the edited answer at the bottom):
You have more control which values of which keys you actually replace and you can replace multiple values in one record
Created 08-23-2016 07:06 AM
The result from ExecuteScript Groovy is:
{bentuk=SD, field2=cd, field3=A2}
Can I get the output with the json format?
thanks for your solutions, im looking forward for your reply 🙂
Created 08-24-2016 01:45 PM
Replace
outputStream.write(inJson.toString().getBytes(StandardCharsets.UTF_8))
by
def outJson = new JsonBuilder(inJson) outputStream.write(outJson.toString().getBytes(StandardCharsets.UTF_8))
The referenced sample in StackOverflow already imports jsonBuilder