dcsimg
Which is the best method to read a file that contains 1 million lines ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sujith_Varghese
Posted On:   Tuesday, October 10, 2006 06:24 AM

Hello, I have a file that contains 1 million lines (each line having 1024 bytes). I have to process that file. Which is the best method (fastest) to open/read this file. I tried BufferedReader/ bulk reading / FileChannels etc... (which is best, in above 3 options) All these methods taking 4 to 6 minutes (just to read the file) is it possible (just) to read this file with in 2 minutes??? Please help me.. Thanks in advance , -Sujith    More>>


Hello,


I have a file that contains 1 million lines (each line having 1024 bytes). I have to process that file.


Which is the best method (fastest) to open/read this file.


I tried BufferedReader/ bulk reading / FileChannels etc...
(which is best, in above 3 options)


All these methods taking 4 to 6 minutes (just to read the file)


is it possible (just) to read this file with in 2 minutes???





Please help me..

Thanks in advance ,
-Sujith

   <<Less

Re: Which is the best method to read a file that contains 1 million lines ?

Posted By:   Robert_Lybarger  
Posted On:   Tuesday, October 10, 2006 09:14 AM

This is not the answer you're looking for, but if you do your file I/O on a UNIX-based machine instead of a windows machine, it'll probably speed up w/o modification -- Windows file I/O has always been notably slower in just such situations as those -- reading/writing *really* big files. (Experience: My previous workplace 'upgraded' from solaris to win2k ... all the disk-bound applications magically ran at about half speed / took twice as long.)
About | Sitemap | Contact