微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

从 JavaRdd 中删除以特定符号开头并后跟文本的行

如何解决从 JavaRdd 中删除以特定符号开头并后跟文本的行

我在控制台中以这种方式显示一个 JavaRdd:

[2021-04-12 21:32:17] TestTracker | Starting Suite 'de.adag.TestSuiteVereinbarungen' 
. Which one will be used is undefined. Please,remove duplicated configuration file (or second PowerMock jar file) from class path to have stable tests.[2021-04-12 21:33:03] TestTracker | Finished Suite 'de.adag.TestSuitefinal'Execution duration '00:00:46' 
[2021-04-12 21:33:03] TestTracker | Starting Suite 'de.adag.TestSuitefinakServices' 

我想去掉第二行的文字,只留下[2021-04-12 21:33:03] TestTracker | Finished Suite 'de.adag.TestSuitefinal'Execution duration '00:00:46' 这意味着我想删除 . Which one will be used is undefined. Please,remove duplicated configuration file from class path to have stable tests.

这是我的代码

JavaRDD<String> filteredlines1 = filteredlines.map(line -> line.replaceAll("^\\.","").replaceAll("\\.$","")) ;

它对我不起作用。有没有人对此有任何想法:)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。