Talend 转义字符和文本框的使用

Talend 转义字符和文本框的使用,talend,talend-mdm,Talend,Talend Mdm,tFileOutputDelimited组件中转义字符和文本框的用途是什么?我们如何使用它们 提前感谢……/P> < P>回答您的问题,考虑下面的CSV文件示例 bookId,bookname,description,authorname 1,Grammer,book that has details about grammer,author1 2,Special Characters, book that describes about some escape characters like

tFileOutputDelimited组件中转义字符和文本框的用途是什么?我们如何使用它们


提前感谢……/P> < P>回答您的问题,考虑下面的CSV文件

示例
bookId,bookname,description,authorname
1,Grammer,book that has details about grammer,author1
2,Special Characters, book that describes about some escape characters like \", punctuations and special characters ,etc.,author2
3,Mathematics, book that has mathematical operations like addition +, subtraction -, multiplication *, division / etc, author3
我创建了一个简单的工作,如下所示

在上面的示例中,字符逗号
,“
是分隔符。但是数据之间有一些逗号

写入CSV文件的数据如下所示

.------+------------------+-------------------------------------------------------------------------------------------------------+-------.
|                                                                tLogRow_3                                                                |
|=-----+------------------+-------------------------------------------------------------------------------------------------------+------=|
|bookId|bookName          |description                                                                                            |author |
|=-----+------------------+-------------------------------------------------------------------------------------------------------+------=|
|1     |Grammer           |book that has details about grammer                                                                    |author1|
|2     |Special Characters|book that describes about some escape characters like ", punctuations and special characters ,etc.     |author2|
|3     |Mathematics       |book that has mathematical operations like addition +, subtraction -, multiplication *, division / etc.|author3|
'------+------------------+-------------------------------------------------------------------------------------------------------+-------'

现在,当我从该文件读取数据时,我将得到以下数据

.------+------------------+-------------------------------------------------------+-------------------------------------.
|                                                       tLogRow_3                                                       |
|=-----+------------------+-------------------------------------------------------+------------------------------------=|
|bookId|bookName          |description                                            |author                               |
|=-----+------------------+-------------------------------------------------------+------------------------------------=|
|1     |Grammer           |book that has details about grammer                    |author1                              |
|2     |Special Characters|book that describes about some escape characters like "| punctuations and special characters |
|3     |Mathematics       |book that has mathematical operations like addition +  | subtraction -                       |
'------+------------------+-------------------------------------------------------+-------------------------------------'
如果您注意到,一些数据在
“author”
列的日志中丢失

这是因为数据之间有一个逗号。为了避免这种情况,使用了
文本框
选项。数据中还有一个转义字符,即
\”
。在文件中,它将被打印为
。如果
文本框
的值为
,则需要转义数据中的字符
。为此,必须使用
转义字符
选项,如下所示

现在我得到的输出是

当我阅读这些数据时,我会得到如下数据

.------+------------------+-------------------------------------------------------------------------------------------------------+-------.
|                                                                tLogRow_3                                                                |
|=-----+------------------+-------------------------------------------------------------------------------------------------------+------=|
|bookId|bookName          |description                                                                                            |author |
|=-----+------------------+-------------------------------------------------------------------------------------------------------+------=|
|1     |Grammer           |book that has details about grammer                                                                    |author1|
|2     |Special Characters|book that describes about some escape characters like ", punctuations and special characters ,etc.     |author2|
|3     |Mathematics       |book that has mathematical operations like addition +, subtraction -, multiplication *, division / etc.|author3|
'------+------------------+-------------------------------------------------------------------------------------------------------+-------'
如果您注意到,没有数据丢失


希望这能对您有所帮助。

您好,Viki888,您没有执行任何更改以获得第二次输出。。如果你做了什么,你能给我提供更改吗?我所做的更改是,我在回答中提到的tFileOutputDelimited组件中启用了CSV选项。谢谢你Viki888。。。。但是当我们使用tFixedflowInput组件时,输出即将到来……否则(即tFileInputDelimited……)将不会产生所需的结果。在这种情况下,对于
tFileInputDelimited
,您必须启用
CSV选项。