nsgirish / nifi-executescript-groovy-csv-json-parser

A Groovy script which can be executed within Apache NIFI via ExecuteScript processor to parse CSV data and output JSON records output to flowfile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A Groovy script which can be executed within Apache NIFI via ExecuteScript processor to parse CSV data and output JSON records output to flowfile


Languages

Language:Groovy 100.0%