Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] seperating json data into different columns

hi, i have been trying to seperate the received json file data into different columns, but i cannot do it, i have used 'twritejsonfield' but the columns are getting the name of the column also..i just want the values to get loaded..some one please help..

This is what i have done so far..
Labels (3)
17 Replies
Anonymous
Not applicable
Author

Hi,

Could you please elaborate your case with an example with input and expected output values?

Have you tried to use component TalendHelpCenter:tExtractJSONFields?

Best regards
Sabrina
Anonymous
Not applicable
Author

hi,
i have used 'textractjson' to parse columns  for the first two columns id and meta its working fine but for 'payload' column i am getting a error as: 

'Oct 08, 2014 11:05:59 AM net.sf.json.xml.XMLSerializer getType 

INFO: Using default type string
Error on line 1 of document  : An invalid XML character (Unicode: 0x8) was found in the element content of the document. Nested exception: An invalid XML character (Unicode: 0x8) was found in the element content of the document.'

can you please help me with the error. The job screenshot is attached along with the screenshot of the components detail.
 op data expected
 ip data
Anonymous
Not applicable
Author

read the error and you got the answer :
An invalid XML character (Unicode: 0x8) was found in the element content of the document

if you look for information about Unicode : 0x8, it's the backspace caracter that cause trouble
regards
laurent
Anonymous
Not applicable
Author

i used tmap to trim the columns which were giving error but now a new error is coming up kindly see the screenshot.
i tried using tmap after textractjson also but then the previous error used to come.


kindly help..
Anonymous
Not applicable
Author

you have to modified your source file (json) I guess. Trim your data after parsing json file is 'too late'.
So add a 'cleansing job' to normalize it and be able to parse it with talend component. (try an hexa editor to find this caracter in source)
hope it help
regards
laurent
Anonymous
Not applicable
Author

i cant change my source(json) so is there any way i can do it with talend.
why the trim() function doesnt work in tmap to trim the data??
Anonymous
Not applicable
Author

trim() is for extra caracters at tstart and end string.
perhaps try replace carater ascii 0x8 by empty carater (string)

String.replaceAll("\\x08","")

here's some more explanation :
http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/
regareds
laurernt
Anonymous
Not applicable
Author

i should be using this in tjava component right??
if yes where i should be placing it in my job...for reference screenshots are already attached in previous posts.
thanks for your help...
Anonymous
Not applicable
Author

how can i decode b64 value in talend??
plz help..