aspose file tools*
The moose likes Java in General and the fly likes Treemap and Hashmap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Treemap and Hashmap" Watch "Treemap and Hashmap" New topic
Author

Treemap and Hashmap

Peter Burke
Greenhorn

Joined: Sep 28, 2004
Posts: 4
How would you go about removing all punctuation besides ones like this "my-o-my" and then count up all occurances of the every word and print it out.
Doin all this while reading in a file that has text it in from a speech.
Thanks!
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
You should look at classes like String, StringBuffer, StringTokenizer, InputStream, and FileReader. These should provide many of the methods you need to accomplish this task.

Let us know what you come up with. There will be plenty of people here that will help answer specific questions when you run into any problems. Please be sure to illustrate what you have tried so we can help you from there.

Keep Coding!

Layne


Java API Documentation
The Java Tutorial
Peter Burke
Greenhorn

Joined: Sep 28, 2004
Posts: 4
yeah yeah yeah, I know how to bring in the file and print it out, my problem is that I don't know how to edit the file once I have it stored away!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Originally posted by Peter Burke:
I don't know how to edit the file once I have it stored away!


Hence Layne's recommendation to look at String, StringBuffer, and StringTokenizer.


[Jess in Action][AskingGoodQuestions]
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
and of course the regexp package...


42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Treemap and Hashmap