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

时间:2016-09-23 20:32:53

标签: file csv input pentaho

Pentaho 6.1 CSV文件输入步骤我有个奇怪的问题。

我在CSV文件中有以下值:

  

“2016年9月16日”, “测试”, “”, “测试”,“检验,   SL”, “[测试]”, “测试”,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: "

预览选项工作正常,但当我尝试将该内容导入数据库表并执行转换时,我收到以下错误:

  

2016/09/23 22:04:46 - 写到log.0 - 2016/09/23 22:04:46 - 写到   log.0 - 2016/09/23 22:04:46 - 写入log.0 - at   org.pentaho.di.core.row.value.ValueMetaBase.convertStringToNumber(ValueMetaBase.java:803)   2016/09/23 22:04:46 - 写入log.0 - at   org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1631)   2016/09/23 22:04:46 - 写入log.0 - ... 7更多2016/09/23 22:04:46    - 写入log.0 - 引起:org.pentaho.di.core.exception.KettleValueException:2016/09/23   22:04:46 - 写入log.0 - 请求字符串:无法转换字符串   to number:在位置1找到值的非数字字符   [SL”, “[测试]”, “测试”,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栏)。我不明白为什么因为预览选项有效。

1 个答案:

答案 0 :(得分:1)

我尝试了你的输入集,不管你信不信,我对嵌入式逗号没有任何问题。似乎问题是转换数字字段。我将它们设置为Number数据类型并使用蒙版进行摆弄,但唯一能使其工作的是指定修剪类型“左”。当我这样做时,一切都很好。

enter image description here