[英]Pentaho spoon + redoing field enclosures in output file
I'm new to Pentaho 8.3 CE (Spoon) and am trying add an extra column to a CSV file by concatenating 3 other text fields together.我是 Pentaho 8.3 CE (Spoon) 的新手,我正在尝试通过将其他 3 个文本字段连接在一起来向 CSV 文件添加一个额外的列。 I'm using 2 options - Calculator and the inbuilt 'Concat fields' transformations.我正在使用 2 个选项 - 计算器和内置的“Concat 字段”转换。
The issue I'm facing is that some rows are enclosed by " " while others aren't... eg我面临的问题是有些行被 " " 包围,而另一些则不是......例如
Ideally, I want,理想情况下,我想要,
I find I can't get the final " to enclose each line, so it looks like "One thing, another... Final thing我发现我无法得到最后的“来包围每一行,所以它看起来像“一件事,另一件事......最后一件事
How do I get Pentaho to add that final " on? I've set to force the enclosure on.我如何让 Pentaho 添加最后的“打开”?我已经设置强制打开外壳。
First strip the double quotes with a String operations step or a Replace in String step (the latter allows regexp search and replace).首先使用字符串操作步骤或替换字符串步骤(后者允许正则表达式搜索和替换)去除双引号。
The use a Concat strings step to join them all together comma separated.使用 Concat 字符串步骤将它们全部连接在一起,以逗号分隔。
Finally, either prepend & append double quotes, or when writing out with eg a text file output, add the enclosure character.最后,要么在前面加上双引号,要么在用文本文件输出写出时,添加包围字符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.