Support Questions

Find answers, ask questions, and share your expertise

How to delete a row/drop a column in nifi

avatar

I am new to Apache Nifi and trying to evaluate the tool according to the business requirement, and stuck with few scenarios.

I ingested csv files using ListFile and FetchFile Processor, now i want to perform below task on the ingested data:

1. Delete one single row from ingested data depending on any given condition.

2. Drop any one column, i can specify the name of the column too.

3. Can i transform null values present within the ingested csv?

Thanks in Advance!

1 ACCEPTED SOLUTION

avatar
Super Collaborator

@Garima Verma , you can use RouteOnAttribute Processor to filter out the records based on the condition. One way to drop the column is to use ExtractText processor that assigns the columns to attributes using regular expression and in ReplaceText processor, you can drop that attribute from the FlowFile content. You can transform your null values by using ReplaceText processor which uses Nifi Expression language.

I would recommend you to go through Nifi Processors and Nifi Expression language. Here is the link:

https://nifi.apache.org/docs.html

You can go through all processors and expression language guide here.

View solution in original post

1 REPLY 1

avatar
Super Collaborator

@Garima Verma , you can use RouteOnAttribute Processor to filter out the records based on the condition. One way to drop the column is to use ExtractText processor that assigns the columns to attributes using regular expression and in ReplaceText processor, you can drop that attribute from the FlowFile content. You can transform your null values by using ReplaceText processor which uses Nifi Expression language.

I would recommend you to go through Nifi Processors and Nifi Expression language. Here is the link:

https://nifi.apache.org/docs.html

You can go through all processors and expression language guide here.