Extracting JSON data from a file using JSONPath without setting a loop node - 7.3

JSON

Version
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > File components (Integration) > JSON components
Data Quality and Preparation > Third-party systems > File components (Integration) > JSON components
Design and Development > Third-party systems > File components (Integration) > JSON components
Last publication date
2024-02-21

This scenario describes a two-component Job that extracts data from the JSON file Store.json by specifying the complete JSON path for each node of interest and displays the flat data extracted on the console.

For more technologies supported by Talend, see Talend components.

The JSON file Store.json contains information about a department store and the content of the file is as follows:

{"store": {
    "name": "Sunshine Department Store",
    "address": "Wangfujing Street",
    "goods": {
        "book": [
            {
                "category": "Reference",
                "title": "Sayings of the Century",
                "author": "Nigel Rees",
                "price": 8.88
            },
            {
                "category": "Fiction",
                "title": "Sword of Honour",
                "author": "Evelyn Waugh",
                "price": 12.66
            }
        ],
        "bicycle": {
            "type": "GIANT OCR2600",
            "color": "White",
            "price": 276
        }
    }
}}

In the following example, we will extract the store name, the store address, and the bicycle information from this file.