Pentaho CSV 文件输入步骤 - 附件中的逗号分隔符

Pentaho CSV File Input step - comma delimiter in enclosures

我在 Pentaho 6.1 CSV 文件输入步骤中遇到奇怪的问题。

我在 CSV 文件中有以下值:

"2016-09-16","test","","test","test, S.L.","[test]","test",39.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000

我在CSV文件中使用输入步骤:

Delimiter: ,
Enclosure: "

预览选项完美运行,但是当我尝试将该内容导入数据库 table 并执行转换时,出现以下错误:

2016/09/23 22:04:46 - Write to log.0 - 2016/09/23 22:04:46 - Write to log.0 - 2016/09/23 22:04:46 - Write to log.0 - at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToNumber(ValueMetaBase.java:803) 2016/09/23 22:04:46 - Write to log.0 - at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1631) 2016/09/23 22:04:46 - Write to log.0 - ... 7 more 2016/09/23 22:04:46 - Write to log.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2016/09/23 22:04:46 - Write to log.0 - requests String : couldn't convert String to number : non-numeric character found at position 1 for value [S.L.","[test]","test",38.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000

我假设以下值 "test, S.L."(第 5 列)有问题。我不明白为什么因为预览选项有效。

我试过你的输入集,信不信由你,我没有遇到嵌入逗号的问题。问题似乎是数字字段的转换。我将它们设置为 Number 数据类型并摆弄了掩码,但唯一让它起作用的是指定 trim 类型的 "Left"。当我这样做时,一切都很好。