Support Questions
Find answers, ask questions, and share your expertise

NIFI add new column dynamically to CSV

NIFI add new column dynamically to CSV


My requirement is to add new columns to existing CSV with header. CSV files in folder having difffernt schema but additional columns are static based on the filename(Getting part of file names seperated by underscore)

I was looking at below link but avroschemaregistry is defined with userdefined schema. In my case , output schema is decided based on input schema that changes frequently based on filenames.

Any solution on how to do this.

Input Data1:


Input Data2:


For both of these input data, I have to add additonal columns like filename, dept

I have different inputs(around 100 files having different formats). I cannot keep writing the schemas in avroschema registry as this schema gets changed. May I know how to achieve this.