Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a file input in Talend studion that contains below type of syntax and i need to extract userid, password from it
"{\"password\":\"aaa\",\"username\":\"aaab\"}"
any suggestion how to parse this json looking kind of field.
i tried tjsonextract but its not working correctly.
i am trying tjava and json.parse but that is also not working.
any suggestions/recommendations ?
Hello @talend777
To parse this json, you would need to replace the \ with "" and then pass it to the tExtractJSONFields component.
tJavaRow Config
tExtractJSONFields Config
Best Regards
Hello @talend777
To parse this json, you would need to replace the \ with "" and then pass it to the tExtractJSONFields component.
tJavaRow Config
tExtractJSONFields Config
Best Regards
Thank you @Dave_Simo
may i know how does your schema looks like for tjsonExtract fields
i tried like below and passed it as string and it removed the / but for some reason its not working for tjsonExtract
String json = String.valueOf("{\"password\":\"bbbb\",\"username\":\"aaaa\"}");
globalMap.put("json", json );
System.out.println("json :" +globalMap.get("json"));