Skip to content

This is a simple Java program that reads a text file and computes the frequency of each character in the file, as well as the total count of non-alphabetic and non-numeric characters. The program then writes the results to a text file called results.txt.

Notifications You must be signed in to change notification settings

salahalshayah/CharacterFrequency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

CharacterFrequencyCounter

CharacterFrequencyCounter is a Java program that counts the frequency of each character in a text file. The program reads a user-specified file, counts the number of occurrences of each character in the file, and outputs the results to a file named results.txt.

Usage

To use the program, follow these steps:

1.Download the CharacterFrequencyCounter.java file to your local machine.

2.Open a terminal or command prompt and navigate to the directory containing the CharacterFrequencyCounter.java file.

3.Compile the program by running the following command:

javac CharacterFrequencyCounter.java

Run the program by running the following command:

java CharacterFrequencyCounter

When prompted, enter the name of the text file you want to analyze.

The program will generate a file named results.txt containing the frequency of each character in the input file.

Sample Input

A sample input file named sample.txt is included in the repository for testing purposes.

Contributing

If you find a bug or have a suggestion for improvement, please feel free to open an issue or submit a pull request.

About

This is a simple Java program that reads a text file and computes the frequency of each character in the file, as well as the total count of non-alphabetic and non-numeric characters. The program then writes the results to a text file called results.txt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages