Search code examples
csvapache-nifi

Write header of csv files in Uppercase and add string to every value in Apache Nifi


I have CSV files like this one below. I would like to change the first line to be in uppercase (the special characters should remain the same):

id;name;description_jobs;name22
5;James;student;James22
7;John;police-officer;John12

The result should look like this:

ID;NAME;DESCRIPTION_JOBS;NAME22
5;James;student;James22
7;John;police-officer;John12

Solution

  • You can use ReplaceText processor and configure it like this:enter image description here.

    Pay attention to the "Search Value" which actually takes first line and to "Replacement Value" which makes it upper case. You will get this output:

    ID;NAME;DESCRIPTION_JOBS;NAME22
    5;James;student;James22
    7;John;police-officer;John12