如何使用Java根据条件从大文件中捕获第二列中的数据 [英] How to capture the data in second column from a large file based on a condition using java

查看:97
本文介绍了如何使用Java根据条件从大文件中捕获第二列中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.
我有一个在运行测试用例时记录一些数据的文件.
文件名-Teju.log
这是文本格式Teju.log的一部分.

2015年10月5日10:50:13.997 TR [Comp.cc:2-stop](9115)[0]试图停止比较"

问题:

我想记录一下收到尝试停止比较"的消息"的时间

谁能帮我解决这个问题.我必须用java

Hi.
I have a file which logs some data while running the test case.
file name - Teju.log
This is the part of text form Teju.log

2015-10-05 10:50:13.997 TR [Comp.cc :2 - stop ]( 9115) [ 0] >> Trying to stop ''Comp''

Problem:

I want to capture the time when we get the message "Trying to stop ''Comp''"

Can anyone please help me to solve it. I have to write it in java

推荐答案

编写它.研究读取文件所需的类和处理字符串的类.请参见 https://docs.oracle.com/javase/tutorial/essential/io/file.html [^ ]等等.
So get writing. Study the classes required to read a file and the one for manipulating strings. See https://docs.oracle.com/javase/tutorial/essential/io/file.html[^] etc.


这篇关于如何使用Java根据条件从大文件中捕获第二列中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆