Linux 水壶-以逗号作为小数点读取CSV

Linux 水壶-以逗号作为小数点读取CSV,linux,pentaho,business-intelligence,kettle,pdi,Linux,Pentaho,Business Intelligence,Kettle,Pdi,我对Pentaho数据集成(又名Ketter)进行了一次转换,我要做的第一件事是使用“CSV输入”映射平面文件 我在windows上从未遇到过这一步的问题,但现在我正在将spoon将要运行的服务器更改为linux服务器,而现在我在解析(将字符串转换为整数)方面遇到了问题 简而言之,转换的作用是: CSV输入:用于映射我的CSV中的所有字段。我使用ISO-8859-1编码 筛选行:用于获取某些特定行 脚本值/Mod:用于更改某些字段上的某些值 现在,出现问题的步骤是: 选择/重命名值:用于将标题

我对Pentaho数据集成(又名Ketter)进行了一次转换,我要做的第一件事是使用“CSV输入”映射平面文件

我在windows上从未遇到过这一步的问题,但现在我正在将spoon将要运行的服务器更改为linux服务器,而现在我在解析(将字符串转换为整数)方面遇到了问题

简而言之,转换的作用是:

CSV输入:用于映射我的CSV中的所有字段。我使用ISO-8859-1编码

筛选行:用于获取某些特定行

脚本值/Mod:用于更改某些字段上的某些值


现在,出现问题的步骤是:

选择/重命名值:用于将标题重命名为我的表列,以便我可以在表中插入数据。每个标签上都有什么

选择并更改(选项卡)*忽略空字段

FieldName重命名为
Códigodigo_客户

元数据(制表符)*省略空字段

FieldName将toTypeBinary重命名为NormalData格式Lenient?Lenient数字转换?
Códigodigo_客户积分nn


我得到的错误是:

2015/06/03 09:49:10 - Select values.0 - ERROR (version 5.3.0.0-213, build 1 from 2015-02-02_12-17-08 by buildguy) : Unexpected error
2015/06/03 09:49:10 - Select values.0 - ERROR (version 5.3.0.0-213, build 1 from 2015-02-02_12-17-08 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 
2015/06/03 09:49:10 - Select values.0 - Unexpected conversion error while converting value [codigo_cliente String<binary-string>] to an Integer
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 - codigo_cliente String<binary-string> : couldn't convert String to Integer
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 - codigo_cliente String<binary-string> : couldn't convert String to number : non-numeric character found at position 7 for value [21.237,00]
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.getInteger(ValueMetaBase.java:1780)
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:3537)
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.trans.steps.selectvalues.SelectValues.metadataValues(SelectValues.java:326)
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.trans.steps.selectvalues.SelectValues.processRow(SelectValues.java:375)
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2015/06/03 09:49:10 - Select values.0 -     at java.lang.Thread.run(Thread.java:744)
2015/06/03 09:49:10 - Select values.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 
2015/06/03 09:49:10 - Select values.0 - codigo_cliente String<binary-string> : couldn't convert String to Integer
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 - codigo_cliente String<binary-string> : couldn't convert String to number : non-numeric character found at position 7 for value [21.237,00]
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToInteger(ValueMetaBase.java:1036)
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.getInteger(ValueMetaBase.java:1720)
2015/06/03 09:49:10 - Select values.0 -     ... 5 more
2015/06/03 09:49:10 - Select values.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 
2015/06/03 09:49:10 - Select values.0 - codigo_cliente String<binary-string> : couldn't convert String to number : non-numeric character found at position 7 for value [21.237,00]
2015/06/03 09:49:10 - Select values.0 - 
2015/06/03 09:49:10 - Select values.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToInteger(ValueMetaBase.java:1028)
2015/06/03 09:49:10 - Select values.0 -     ... 6 more
其中一行:

2015;4;CERT;Custo Apropriado;CUSTO SERVIÇO PRESTADO;PESSOAL;14520 .201;87.979,00;SOF HAR;00077864;SQ 36525;FUNDACAO ABCD;1383;FP;;1048;.;.;2030;1.076,35;,00
如果更容易看到的话,这一行中我的名为“Código”的列(稍后在选择值步骤中将成为“codigo_cliente”)的值是87.979,00

在不更改CSV文件的情况下,解决此问题的最佳方法是什么?

我找到了解决方法。我必须在“选择值”步骤中设置一些字段,以便它能够理解我的格式:

格式小数分组
#,#######,.


如果有人能想出更好的办法,请在这里分享:-)

正如@LeonardoSibela建议并自行回答的那样,问题在于格式

理想情况下,除了两台机器之间的一些特定于JVM的行为(例如类加载),应该没有显著差异

那么到底有什么不同呢?系统的区域设置

例如,如果您的Linux服务器设置为一个区域设置,该区域设置知道
,#######
,但数据根位于一个区域设置知道
。######
的系统中,则存在一个(可解决的)问题

正如您在自己的回答中提到的,您必须让流程知道数据的服务格式

i、 e:

  • 格式
    。。。。。。。。。。。。。。。。。。。。。。。。。
  • 十进制
  • 分组
2015;4;CERT;Custo Apropriado;CUSTO SERVIÇO PRESTADO;PESSOAL;14520 .201;87.979,00;SOF HAR;00077864;SQ 36525;FUNDACAO ABCD;1383;FP;;1048;.;.;2030;1.076,35;,00