Working with JSON files
JavaScript Object Notation (JSON) is a lightweight language-independent data interchange format. It uses conventions similar to the C or JavaScript languages, with some rules for the representation of structured data. The object is represented as a collection of the name_of_field:value_of_field
pairs and you can have an array of these elements using the []
characters.
PDI allows reading and writing these kinds of files using the JSON input and JSON output steps from the Input category. Let's see an example of reading a JSON file. Let's assume that you have a file named museums.js
that you want to read for further processing. The file has the following information:
{"data": { "museum": [ { "country": "Italy", "city": "Venice", "id_museum": "109" "name": "Palazzo Ducale"}, { "country": "Mexico", "city": "Mexico City", "id_museum": "36" "name": "Museo de Arte Contemporaneo de Monterrey"}, { "country": "Italy", "city...