468,510 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,510 developers. It's quick & easy.

read a file from different line number

Hi All,

I have a text file.The file size is very big.I have to read the file from different line number.
e.g

File test.txt contains 10000000 lines and more.The 1st thread read the file from line 1 to 1000.2 nd thread read the file from line 1100 to 2000.3 rd thread read the file from line 2100 to 3000.. so on.

Please help me.

Thanks!
vaskar
Jun 3 '08 #1
1 1228
JosAH
11,448 Expert 8TB
Hi All,

I have a text file.The file size is very big.I have to read the file from different line number.
e.g

File test.txt contains 10000000 lines and more.The 1st thread read the file from line 1 to 1000.2 nd thread read the file from line 1100 to 2000.3 rd thread read the file from line 2100 to 3000.. so on.

Please help me.

Thanks!
vaskar
Better have one thread read the entire file and dispatch chunks of it to different
threads. A hard disk can 'read ahead' and your scenario spoils that. Also have
a look at the API documentation for the ByteBuffer class.

kind regards,

Jos
Jun 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by sea | last post: by
18 posts views Thread by jas | last post: by
40 posts views Thread by Abby | last post: by
6 posts views Thread by Samuel M. Smith | last post: by
9 posts views Thread by Adi | last post: by
6 posts views Thread by Thomas Kowalski | last post: by
9 posts views Thread by flebber | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.