Reputation:
I have a nifi output in the following format:
{ "sentiment" : "NEUTRAL", "clientid" : "1", "taxonomies" : "[51,41]", "type" : "twitter", "socialtags" : "[\"research\",\"Pembrolizumab\",\"immunotherapy\",\"lungcancer\",\"clinicaltrial\"]", "url" : "https://twitter.com/ValleyHospital/status/905770926368804866", "timestamp" : "1504787591913" }
I need to remove the double quotes around the values for socialtags & taxonomies, the final output is expected as follows:
{ "sentiment": "NEUTRAL", "clientid": 1, "taxonomies": [51,41], "type": "twitter", "socialtags": ["research", "Pembrolizumab", "immunotherapy", "lungcancer", "clinicaltrial"], "url": "https: //twitter.com/ValleyHospital/status/905770926368804866", "timestamp": 1504787591913 }
The values of socialtags and taxonomies are integer and string arrays and hence can have any number of values including no values, in case of no values it will return just [ ] as the value, how can I remove these double quotes.
Upvotes: 1
Views: 1562
Reputation: 18630
You could use ReplaceText with Search Value "[ and Replacement Value of [
Then another ReplaceText with SearchValue ]" and Replacement Value ]
Upvotes: 3