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", ...

Get Pentaho Data Integration Cookbook Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.