Warm tip: This article is reproduced from serverfault.com, please click

Read correctly a value which includes the file's delimiter

发布于 2021-01-04 12:02:30

I have a column which suppose to take the value: hello, Ted

But because the delimiter of the file is "," it separates the sentence into two columns.

column1: hello

column2: Ted

How can I output the: hello, Ted?

Thanks in advance.

Questioner
DrGenius
Viewed
0
Omar AlSaghier 2021-01-18 19:49:31

You can read the file with "tFileInputRow" first as line by line, and "look and replace" for each line for the comma with space (", ") and replace it with space only (" ") using a piece of Java code inside "tJavaRow". After that try to extract the fields based on the desired schema using tExtractFields component and move on as usual.