- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我对 Pentaho 数据集成(又名 Kettle)进行了转换,我做的第一件事是使用“CSV 输入”来映射我的平面文件。
我在 Windows 上的这一步从来没有遇到过问题,但现在我正在将 spoon 将要运行的服务器更改为 linux 服务器,现在我遇到了解析问题(将字符串转换为整数)。
简而言之,转换的作用是:
CSV 输入:用于映射我的 CSV 中的所有字段。我使用 ISO-8859-1 编码。
过滤行:用于获取一些特定的行。
脚本值/Mod:用于更改某些字段的某些值。
现在,导致问题的步骤:
选择/重命名值:用于将标题重命名为我的表格列,以便我可以在我的表格中插入数据。每个选项卡上有什么?
选择并更改(选项卡)*省略空字段
字段名重命名为
Código codigo_cliente
元数据(制表符)*省略空字段
字段名重命名为 类型 二进制到普通数据格式宽容? 宽松的数字转换?
código codigo_cliente integer n n n />
我得到的错误是:
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
出现此问题是因为,在此字段中,我在 CSV 文件中使用逗号作为小数点。
这是我的 CSV 文件的样子:
我的 CSV 文件的标题:
Ano;Mês;Diretoria;Tipo;Tipo de macrorubrica;Macrorubrica;Conta contábil;Código;Cliente;OS;Descrição;Fornecedor;Documento;Tipo documento;Nota;Atividade;Tipo atividade;Descrição;UA;Valor;Orçado
其中一行:
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 文件的情况下,解决此问题的最佳方法是什么?
最佳答案
我找到了 the answer给它in two forums .我必须在“选择值”步骤中设置一些字段,以便它能够理解我的格式:
格式十进制分组
#,###.##, 。
如果有人能想到更好的东西,请在这里分享:-)
关于linux - Kettle - 以逗号作为小数点读取 CSV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30620969/
我有一个字符串 "1,23,45,448.00",我想用小数点替换所有逗号,用逗号替换所有小数点。 我需要的输出是“1.23.45.448,00” 我尝试用 . 替换 , 如下: var mystri
我刚刚开始阅读 C。 情况: x = ( y = 3, ( z = ++y + 2 ) + 5 ) 它首先评估y = 3,然后评估( z =++y + 2) 我的问题: 它应该首先评估( z =++y
我是 VIM 初学者,我有一个奇怪的问题。我开始在终端模拟器中使用 vim,但今天我转向了 gVim。然后我意识到我不能在插入模式下写逗号!我试过 :map , , :imap ,都说没有找到映射。然
我上面有一个 JavaScript 正则表达式函数代码: function AcceptDigits(objtextbox) { var exp = /[^\d{1,3}]/g; ob
我需要使用 Java 的 split() 方法分割字符串。如何编写某个单词的分隔符的正则表达式模式?例如“和”? 我得到了分割空格和逗号的模式,即 [,\\s] 但我想添加单词 and ,以便它也成为
我们通常使用逗号来强调句子中的某些内容。但是说到搜索引擎优化,我只是想知道这是否有用,尤其是当标题标签或页面标题中所需的字符数有限(65到70个)以便爬虫读取时。我们是否需要使用逗号? 最佳答案 页面
我想找出每个学科学期的学生上课人数。以下是给出正确答案的查询 select semester,subject,count(stdId) from tblSubjectMaster group by s
int m = 5, d = 12, y = 1975, val; // May 12, 1975 谁能解释一下下面代码行中逗号运算符的功能/用途: val = (d+=m<3?y--:y-2
我不能在 Visual Studio 2013 中使用 Ctrl+, 和在 Windows 8.1 中使用 Pycharm。有没有办法找到哪个应用程序占用了这个快捷方式/热键? 我试过 Windows
我发现很难用谷歌搜索 powershell 中这两种执行方法调用的区别的答案。 : $member = "1.2.3.4:567" # IPaddress + port for demonstrati
谁能建议我如何在 emacs 中通过 n 逗号前进(或后退)? 我正在尝试浏览 CSV 文件 我知道我可以做类似的事情: C-u 100 M-f 但是能够在逗号上做更多的正则表达式会更准确 最佳答案
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
这是一个棘手的问题,我会尽力描述它。 我有一个文本输入,用户可以在标签中输入。 用户在输入中键入标签(例如“starcraft”)并按下逗号键后,我希望逗号之前的所有字符(即单词“starcraft”
我如何打印 csv 文件中逗号后的最后一个值,我想循环遍历该文件并打印出最后一个值: 数据: 20181016135716, 00-00-00-00-00-04, 10.0.0.1, 10.0.0.8
这个问题在这里已经有了答案: How to format the HH:mm:ss separators of a TimeSpan in a culture-aware manner? (3 个答
我想去掉除数字、$、逗号 (,) 之外的所有内容。 这只是 strip 字母 string Cadena; Cadena = tbpatronpos6.Text;
我已经在我的 xml 文件中创建了一个编辑文本。这是我的代码: 问题是在我的输出项目中它只能工作其中一个。只有点或只有逗号。怎么了 ?在模拟器中工作正常,只有在我的版本中没有。 最佳答案 我用不同
我正在尝试编写一个正则表达式来提取由空格分隔的单词(可选逗号 + 空格),从单词中删除“堆栈”前缀(如果有的话)。我正在尝试找到一个纯正则表达式解决方案,而无需对结果进行任何后处理或类似(如果可能)。
我正在尝试在数据库中插入一些数据,但遇到了一些麻烦。目前我无法将数据添加到我的表中,我不知道为什么。 我正在使用一些您不需要理解的通用方法,这适用于我的所有项目,并且在任何项目中都没有任何错误。 以下
我想从 json 中删除尾随逗号, { "key1": "value1", "object": { "key2": "value2", // <- remove comma },
我是一名优秀的程序员,十分优秀!