解析日志文件并获取匹配的数据
从大日志文件(大约 2532910 行)中,我要查找的行很少(例如 10 或 12 行)。匹配和阅读这些行的最佳方法是什么?我的代码是c#的。有没有办法让读取器/流只能读取模式匹配的数据?
谢谢
From the big log file (about like 2532910 lines), the lines that I am looking for are very few (like 10 or 12). What is the best way to match and read these lines? My code is in c#. Is there a way a reader/stream can read only a pattern matching data?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要读取这么大的文件,最好的方法是使用streamReader.ReadLine(),
如下所示:
to read such a big files the best way is to use streamReader.ReadLine()
just like this: