Support Questions

Find answers, ask questions, and share your expertise

read csv and convert one of the column data into lowercase

New Contributor

I'm running NiFi 1.10

My requirement is to read csv data and translate one of the csv column data into csv. What's the best way?

Thanks,

3 REPLIES 3

@sandeep1 There are a few ways to handle this.   Generally speaking you need to pick up the file, parse the file, transform the file, and send it on.   Part of the fun with NiFi is completing this task.   My recommendation is to start with some known CSV examples.  Get them working, then adjust them for your scenario.  

 

 

If you reply with a sample of your CSV,  and more clear idea of what you are doing I can provide a better example or a template.   How are you going to get the CSV into NiFi?  

 

Also your post subject, and the body conflicts:   Do you want to do csv to lower case  OR parse a column to get a different csv?

New Contributor

I'm getting csv file by GetFile processor and then passing onto next processor to convertCSVtoAvro.

 

Before converting to Avro format I've to transform one of the column data to lower case.

 

CSV Sample below, I need to read this csv and convert "Causes" column data into lower case and other column data to be as is.

 

CausesSourceDate
Application Performs the wrong functionApplication06-06-18
Performs Right function but Takes too LongApplication06-06-18
Mis-matched Sequencing During Application executionApplication06-06-18
Middle ware failure with no AcknowledgmentWebServer06-06-18
Third Party Application or License errorOther06-06-18

 

 

 

 

New Contributor

I was able to do it with a issue.

I used UpdateRecord Processor

In Properties added -
/Causes                            ${field.value:toLower()}

This converts values to Lower but it creates an additional header line