File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

JavaRanch » Java Forums » Java » Java in General
Bookmark "reading in file content" Watch "reading in file content" New topic

reading in file content

Tony Cossie

Joined: Mar 11, 2001
Posts: 13
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.
Tony Cossie

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

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).]
GeeCON Prague 2014
subject: reading in file content