xpath query for json file

Highlighted
Eight Stars

xpath query for json file

Hi Talend Team,
I have json file and need to be inserted into mysql database.
so here am unable to fetch the data from one of the array.please help me out
Am using xpath query.
example
xyz:
here i need to get "abc" in one column and "def" in another column.am unable to write the Xpath for that one.
Appreciate for your response.
Regards,
rekha 
Six Stars

Re: xpath query for json file

Hi,
The json format you provided is incorrect. you can check this validator https://jsonformatter.curiousconcept.com/
Once you checked it you can browse it from the JSON format available in the metadata where you can fetch the columns.
Valid JSON
{
"xyz":
{
"col1":,
"col2":
}
}


Regards,
Avinash.B
8885453419
One Star

Re: xpath query for json file

Hi avinashbasetty, 
have you an idea how I can get the position of a data on a json file.
Example:
Input file
{
    "product":
    }]
}
resul wished:
 Product                      productPrice_position          name
12-0000027935            0                                  First Component MR Price
12-0000027935            1                                  First Component's OT price
thanks

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download