tjava在talend中的打印输出中获取字符串
currently I found an alternative to fetch the string output in Java using Talend Studio:
tJava code:
String output=((String)globalMap.get("tSystem_1_OUTPUT"));
System.out.println("Printing the error code 1 : "+StringUtils.substringBetween(output,"source count:", "destination count:"));
tJava output:
Printing the error code 1 : ', '1000')
('
Expected Result:
Printing the error code 1 : 1000
However, tJava takes the result exactly between string " source count:' " and "目的地计数:“,因此包括括号和所有。 The expected result is only to get the value 1000.
How do I apply this java code to fetch the correct output?
currently I found an alternative to fetch the string output in Java using Talend Studio:
tJava code:
String output=((String)globalMap.get("tSystem_1_OUTPUT"));
System.out.println("Printing the error code 1 : "+StringUtils.substringBetween(output,"source count:", "destination count:"));
tJava output:
Printing the error code 1 : ', '1000')
('
Expected Result:
Printing the error code 1 : 1000
However, tJava takes the result exactly between string " source count:' " and " destination count: ", so that included the bracket and all. The expected result is only to get the value 1000.
How do I apply this java code to fetch the correct output?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尚未在 Talend 本身内对此进行测试,但尝试一下......
Haven't test this within Talend itself but try this ...