Created 04-30-2022 05:44 PM
I revoked an HTTP request the response is a list of JSON records [{},{},{}] within those records we have some keys with an "_" at the end.
[ {
"name":"json",
"surname":"file",
"which_extention_":"json",
"size_of_file_":"266" }, {}, {} ]
It needs to look like that:
[ {
"name":"json",
"surname":"file",
"which_extention":"json",
"size_of_file":"266" }, {}, {} ]
I tried to use replacetext with the regex : [_$]$ and with this _$ but doesn't work.
Created 05-03-2022 12:35 PM
@Ghilani I believe the solution here is to use record based processors with a JSON RECORD Reader with the schema matching _ names, and a JSON RECORD Writer with schema matching the new names.
Created 05-06-2022 11:50 AM
@Ghilani
While I agree that using record based processors so you can work with single FlowFiles with multiple records in them to make more efficient dataflows, what you are doing here should be possible with a ReplaceText processor in the interim using "Literal Replace":
Here we are searching for the pattern _" and replacing it with just ".
If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.
Thank you,
Matt