aspose file tools*
The moose likes Java in General and the fly likes reading in file content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "reading in file content" Watch "reading in file content" New topic
Author

reading in file content

Tony Cossie
Greenhorn

Joined: Mar 11, 2001
Posts: 13
Hi,
Could anyone tell me how i could read in an entire list of words into one entire string?
Or how do i read in a list of words into a hash set? Because i think that might be quicker?
I'd be grateful if you could give me a code snippet too please.
Thanks.
Tony Cossie
Greenhorn

Joined: Mar 11, 2001
Posts: 13
sorry for multiple posts, but
what's the fastest possible way i could read in a large list of words from 2 files,[ do a search - have that myself] and print out the results?
Iain Lowe
Greenhorn

Joined: Sep 07, 2001
Posts: 12
The quickest (and probably simplest) thing is to use the java.util.Properties class which is a descendant of Map. This means you can create a file of name-value pairs and read the whole file into memory with a call to Properties.load().
Hope this helps
[This message has been edited by Iain Lowe (edited October 17, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: reading in file content