Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

read csv and convert one of the column data into lowercase

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
Highlighted

Re: read csv and convert one of the column data into lowercase

Master Collaborator

@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?

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

Highlighted

Re: read csv and convert one of the column data into lowercase

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

 

 

 

 

Highlighted

Re: read csv and convert one of the column data into lowercase

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

Don't have an account?
Coming from Hortonworks? Activate your account here