Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sorting Large Text Files in Java

807580Jul 28 2010 — edited Jul 29 2010
Hi. I have very large text files that I need to sort. They're typically 4 - 10 million rows long and 5 columns wide of standard double numbers. I'd like to create an object for each row and sort the file based on the contents of the first column and then the second column, but obviously I can't read all the rows into memory at once. Is there any way of sorting the file without reading the entire thing into memory?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2010
Added on Jul 28 2010
14 comments
3,722 views