This console application, called "frequencies", performs frequency analysis on a text file and displays the most frequently used characters.
To use and run the solution, follow the steps below.
- .NET 6 SDK installed on your machine.
- Clone or download the solution from the repository.
- Open a terminal or command prompt and navigate to the root directory of the solution.
To build the solution and generate the executable file, run the following command:
dotnet build --configuration ReleaseTo run the application, open a command prompt and navigate to the directory containing the executable file.
Use the following command:
frequencies.exe <file-path> <case-sensitive-flag>Replace with the path to the text file you want to analyze, and with "Y" for case-sensitive analysis or any other value for case-insensitive analysis.
For example, to analyze the sample.txt file in case-insensitive mode:
frequencies.exe sample.txt NThis command assumes that the frequencies.exe file is in the current directory. Replace sample.txt with the path to the text file you want to analyze. The N flag specifies case-insensitive analysis. Use Y for case-sensitive analysis.
The application will display the following information:
- The total number of characters read, excluding whitespace characters.
- The top 10 most frequent characters, along with the number of occurrences of each.