nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Burgess <>
Subject Re: Convert CSV File to JSON
Date Wed, 03 May 2017 19:56:15 GMT
If all the CSV files had the same number of columns, you might be able to use ExtractText ->
SplitText -> ReplaceText to achieve this. However since your CSV files will have different
column names, I will assume that there can be a different number of columns per file.

In the upcoming NiFi 1.2.0 release I believe you'll be able to use ConvertRecord for this,
with a CSV reader and a JSON writer. In the meantime, if you are familiar with a scripting
language such as Groovy, JavaScript, Python/Jython, Lua, JRuby, or Clojure you can use ExecuteScript
for this. I have an example [1] of using Groovy to split a pipe-delimited file, it could be
altered to use commas and to write out JSON instead.



> On May 3, 2017, at 1:07 PM, "" <> wrote:
> Hi ,
> I have a csv file which is provided by client having different column name.
> I wanted to covert the csv contents to JSON.
> Please advice
> --
> View this message in context:
> Sent from the Apache NiFi Developer List mailing list archive at

View raw message