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 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 kind 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": "Florence...