Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 619 Bytes

File metadata and controls

13 lines (7 loc) · 619 Bytes

A Groovy script to parse CSV data to JSON

Summary

Apache NIFI provides controller services such as CSVReader, JSONRecordSetWriter which help to parse CSV data to JSON records. But CSVReader has following attributes which give runtime errors when the CSV data happens to contain the value assigned to them

  • Quote Character (default value is ")
  • Escape Character (default value is )

The above attributes of CSVReader cannot be assigned as empty strings.

In these scenarios we can use the native libraries of groovy language to write a simple CSV to JSON parser and run it via NIFI ExecuteScript processor