Extraire des données JSON d'un fichier en utilisant le JSONPath sans configurer de nœud de boucle - 7.3

JSON

Version
7.3
Language
Français
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
Studio Talend
Content
Création et développement > Systèmes tiers > Composants File (Intégration) > Composants JSON
Gouvernance de données > Systèmes tiers > Composants File (Intégration) > Composants JSON
Qualité et préparation de données > Systèmes tiers > Composants File (Intégration) > Composants JSON
Last publication date
2024-02-22

Ce scénario décrit un Job à deux composants qui extrait des données du fichier JSON Store.json en spécifiant le chemin JSON complet pour chaque nœud présentant un intérêt et affiche les données plates extraites dans la console.

Pour plus de technologies supportées par Talend, consultez Composants Talend.

Le fichier JSON Store.json contient des informations concernant un magasin et son contenu se présente comme suit :

{"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
        }
    }
}}

Dans l’exemple suivant, vous allez extraire de ce fichier le nom du magasin, son adresse et les informations sur les vélos.