开发者

Reading defining line of text file in java

开发者 https://www.devze.com 2023-01-18 17:21 出处:网络
I am trying to develop application for android . how I can get the defining line of textfile ? For instanceI have to read 15. line of textfile. how I 开发者_JAVA百科can do that?Unless you know each l

I am trying to develop application for android . how I can get the defining line of textfile ? For instance I have to read 15. line of textfile. how I 开发者_JAVA百科can do that?


Unless you know each line has the same length, the only way is to read each line until you get to the 15th. You can't skip to a specific line unless you have a way to calculate its offset, or maintain some sort of index file.

0

精彩评论

暂无评论...
验证码 换一张
取 消