【问题标题】:Pentaho data Integration - cut a string after comma (not in a fixed position)Pentaho 数据集成 - 逗号后切字符串(不在固定位置)
【发布时间】:2018-03-30 14:11:15
【问题描述】:

在 Pentaho 数据集成中,我需要(来自 Excel 输入)替换特定字符串。

我需要删除第一个逗号之后的所有字符(可以是随意的位置),像这样:

"A,b,c,f" -> "A"

"aaaaa,bbbb,cccc" -> "aaaaa"

我尝试过string cut,但它允许在特定数量的字符(而不是特定的单词或字符,例如逗号)之后剪切。

在我的 sql 中是:SUBSTRING_INDEX(technician, ',', 1).. 但是 Pentaho 会是什么?

谢谢

【问题讨论】:

    标签: pentaho pentaho-spoon pentaho-data-integration


    【解决方案1】:

    您可以使用替换字符串步骤,将其设置为使用 RegEx 进行搜索和替换,将搜索 RegEx 设置为 ([^,]),. 并将替换字段设置为 $1。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-21
      • 1970-01-01
      • 2011-06-25
      • 1970-01-01
      • 2012-11-01
      • 1970-01-01
      • 2013-09-16
      • 1970-01-01
      相关资源
      最近更新 更多