Benetl, a free ETL tool for files working with postgreSQL and MySQL
Benetl is a free ETL tool
an ETL to easily manage csv/txt/xls/json files
Benetl, a free ETL tool for files working with postgreSQL and MySQL, is sixteen years old! 70012
downloads

Home page > Documentation > 20. JSON example

20. JSON example


Here is the content of the JSON test file:


[
        {
                "id": "0001",
                "type": "donut",
                "name": "Cake",
                "ppu": 0.55,
                "batters":
                        {
                                "batter":
                                        [
                                                { "id": "1001", "type": "Regular" },
                                                { "id": "1002", "type": "Black Chocolate" },
                                                { "id": "1003", "type": "Blueberry" },
                                                { "id": "1004", "type": "Devil's Food" }
                                        ]
                        },
                "topping":
                        [
                                { "id": "5001", "type": "None" },
                                { "id": "5002", "type": "Glazed" },
                                { "id": "5005", "type": "Sugar" },
                                { "id": "5007", "type": "Powdered Sugar" },
                                { "id": "5006", "type": "Chocolate with Sprinkles" },
                                { "id": "5003", "type": "Chocolate" },
                                { "id": "5004", "type": "Maple" }
                        ]      
        },
        {
                "id": "0002",
                "type": "donut",
                "name": "Raised",
                "ppu": 0.55,
                "batters":
                        {
                                "batter":        
                                        [
                                                { "id": "1001", "type": "Regular" }
                                        ]
                        },
                "topping":
                        [
                                { "id": "5001", "type": "None" },
                                { "id": "5002", "type": "Glazed" },
                                { "id": "5005", "type": "Sugar" },
                                { "id": "5003", "type": "Chocolate" },
                                { "id": "5004", "type": "Maple" }
                        ]          
        },
        {
                "id": "0003",
                "type": "donut",
                "name": "Old Fashioned",
                "ppu": 0.55,
                "batters":
                        {
                                "batter":
                                        [
                                                { "id": "1001", "type": "Regular" },
                                                { "id": "1002", "type": "Chocolate" }
                                        ]
                        },
                "topping":
                        [
                                { "id": "5001", "type": "None" },
                                { "id": "5002", "type": "Glazed" },
                                { "id": "5003", "type": "Chocolate" },
                                { "id": "5004", "type": "Maple" }
                        ]
        }
]

JSON will be understood by Benetl as this:

PNG - 6.6 kb

Add an extra field "ladate" for the date:

PNG - 21.7 kb

Then define the ETL:

PNG - 6.9 kb

Here is the data extracted from the JSON file:

PNG - 30.5 kb

These data loaded in the database:

PNG - 97 kb

Site Map -  Contact: benoit@benetl.net
Benoît Carpentier - Benetl a free ETL tool - Copyright (c) 2007 - 2024


Search Engine Optimization and SEO Tools