制作的BufferedReader从一个.txt文件而不是开头的中间开始? [英] Make BufferedReader start from the middle of a .txt file rather than the beginning?

查看:103
本文介绍了制作的BufferedReader从一个.txt文件而不是开头的中间开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含近6000行的长.txt文件!有时候,我需要检索信息。符合5000是否有可能开始从线5000读取,而不是从头开始?

I have a LONG .txt file that contains almost 6000 lines! Sometimes I need to retrieve the info. in line 5000. Is it possible to start reading from line 5000 rather than starting from the beginning?

感谢。

推荐答案

无论是6000线长与否取决于平均线的长度。即使有每行100个字符,这是不是真的很长。

Whether 6000 lines are long or not depends on the average line length. Even with 100 characters per line, this is not really long.

不过,你可以从线5000读取,如果你知道在哪里线5000开始。不幸的是,大部分的时间你就必须通过4999读线1发现了这一点。

Nevertheless, you can read from line 5000 if you know where line 5000 starts. Unfortunately, most of the time you'll have to read lines 1 through 4999 to find that out.

这篇关于制作的BufferedReader从一个.txt文件而不是开头的中间开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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