Sachith Muhandiram
Sachith Muhandiram

Reputation: 2972

Remove " " from a csv using apache nifi

I have a csv looks like this :

id,name,age
"1","sachith","29"
"2","nalaka","29"

I want this to be like :

id,name,age
1,sachith,29
2,nalaka,29

For this I have used : ReplaceText Processor.

In it I have following settings:

Search value : (?s)(^.*$)

Replacement value : ${'$1:replaceAll('\"$1\"',$1)'}

Replacement Strategy : Regex Replace

Evaluation Mode : Entire text

But output file doent have any proper value. I think I am missing the right regular expression for Replacement Strategy.

Or do I have to use a separate processor for this task?

Upvotes: 1

Views: 835

Answers (1)

daggett
daggett

Reputation: 28599

if you want just remove all double quotes the simplest solution:

  • search value (regexp) = "
  • and the replacement just empty value

Upvotes: 2

Related Questions