3

I have a CSV file where it contains id, name, and salary as fields. The data in my CSV file is like below.

id,name,salary
1,Jhon,2345
2,Alex,3456

I want to update the current CSV with new id (id*4)

id,name,salary
4,Jhon,2345
8,Alex,3456

The format of the file in the destination should aslo be CSV. Can anyone tell me the flow? (What processors do I need). I'm very new to nifi. A big thanks in advance.

1 Answer 1

4

Use UpdateRecord processor with the below settings,

Record Reader               CSVReader
Record Writer               CSVRecordSetWriter
Replacement Value Strategy  Literal Value
/id                         ${field.value:multiply(4)}

then it gives the desired result. Just csv in and csv out.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.