tFileInputJSON Use Case-Parse JSON using Talend

tFileInputJSON Use Case-Parse JSON using Talend
4 (80%) 5 votes

tFileInputJSON extracts JSON data from a file according to the JSONPath query, then transferring the data to a file, a database table.

tFileInputJSON  Use Case : This post I will demonstrate you, how to parse JSON File using Talend.  Below is our sample JSON File.

You can download sample file here.

Step 1: Click On Json node from metadata tree view. then provide file name and file which will show you below schema from given JSON.

 tFileInputJson-Create Metadata for JSON
tFileInputJson-Create Metadata for JSON

Step 2: Click on Next. On Next window you need to map desired field from JSON. See the picture below.

tFileInputJson-Metadata field Map, For Extraction

tFileInputJson-Metadata field Map, For Extraction

Below table we have Schema fields and Xpath Mapping.

Absolute Xpath Expression /Person/Address
firstName “../firstName”
lastName “../lastName”
age “../age”
streetAddress “streetAddress”
city “city”
state “state”
postalCode “postalCode”
home “../PhoneNumbers/home”
fax “../PhoneNumbers/fax”

Now we have our input ready, so we can parse it.

Step 3: Drag and drop newly created metadata from JSON, and select tFileInputJson from drop options. See in below picture.

 

tFileInputJs- Select component.
tFileInputJs- Select component.

 

 

 

 

 

 

 

 

Step 4: Add tLogRow component after tFileInputJSON component and connect it with Main connection, then run the job you will see below output.

tFileInputJson sample job with output

tFileInputJson sample job with output

 

 

 

 

 

 

About dwetl

One thought on “tFileInputJSON Use Case-Parse JSON using Talend

  1. Hi,

    I have a complex JSON array data and I couldnt parse either in tExtractJSONFile or tFileInputJson as pe r above steps.

    Please do reply so I will connect with you and explain exactly what I am facing issue.

    Thanks
    Gokula

Leave a Reply to Gokula Cancel reply

Your email address will not be published. Required fields are marked *