Word Count app using tokenizer (Java)

M

mattaseymour

Hey, I have been set the task to create a program that will read in a
text file (.txt), and will display a list of results showing:

- Number of lines in the file
- Number of words in the file
- Number of characters
- Type of histagram, which shows the number of words with a specific
length

The thing is this program must use the tokeniz (token, tokenizer)
function, and i have no idea how to use this. If anyone has any code
which i could use or if someone would be as kind as to get me code it
would be much appreciated.

Thanks ArcH
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Hey, I have been set the task to create a program that will read in a
text file (.txt), and will display a list of results showing:

- Number of lines in the file
- Number of words in the file
- Number of characters
- Type of histagram, which shows the number of words with a specific
length

The thing is this program must use the tokeniz (token, tokenizer)
function, and i have no idea how to use this. If anyone has any code
which i could use or if someone would be as kind as to get me code it
would be much appreciated.

I assume you mean StringTokenizer:

http://java.sun.com/j2se/1.5.0/docs/api/java/util/StringTokenizer.html

Arne
 
M

Matt

Yes that is correct should have been more specific. Do you have any
ideas on how i can do this?

ArcH
 
M

Martin Gregorie

Matt said:
Yes that is correct should have been more specific. Do you have any
ideas on how i can do this?
Don't top post. It annoys people on this list. See further advice below.
Have you actually read Arne's reference? If not, do so.

If your computer doesn't have the Sun J2SE documentation package
installed, go get it from http://www.java.sun.com, install it and use it
to find out about any other classes you may need.
 
A

Andrew Thompson

Matt wrote:

Please refrain from top-posting.
Yes that is correct should have been more specific. Do you have any
ideas on how i can do this?

Read the documentation, write some code, come back
here when you strike a compilation or execution problem
(with the code you have).

What? You weren't expecting us to write it for you, were you?

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top