1

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?

5
  • 1
    the simplest search value (regexp) = " and the replacement just empty value. Commented Nov 5, 2019 at 12:08
  • @daggett yes, this is the answer, Can you please post this as an answer, I can accept it. Commented Nov 5, 2019 at 12:14
  • 1
    Also make sure the fields do not contain any separators before removing the quotes. Commented Nov 5, 2019 at 13:33
  • @Danny_ds what kind of separators do you mean? Commented Nov 5, 2019 at 14:00
  • @Sachith Field separators, like the comma in this case. If those appear in the fields, those fields have to be enclosed by double quotes. Commented Nov 5, 2019 at 17:23

1 Answer 1

2

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

  • search value (regexp) = "
  • and the replacement just empty value
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.