|
1 | 1 | # File Statistics Processor |
2 | 2 |
|
3 | | -Simple Swing-based utility that reads a text file containing an integer count followed by that many integer values, echoes the values to an output file with 10 numbers per line, and appends statistics (minimum, maximum, total, average). |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
4 | 7 |
|
5 | | -- Input format: first integer = file size (count of following integers) |
6 | | -- Output format: first line repeats file size, next lines = values (10 per line), followed by min, max, total, average (one per line) |
7 | | -- UI: uses dialogs to choose input and output files; shows a summary when done |
| 8 | +A Swing-based Java utility that processes integer data files, reformats the output, and calculates comprehensive statistics including minimum, maximum, total, and average values. |
8 | 9 |
|
9 | | -## Quick Start |
| 10 | +## ✨ Features |
| 11 | + |
| 12 | +- **File Processing**: Read and validate integer data files |
| 13 | +- **Formatted Output**: Write data with 10 numbers per line |
| 14 | +- **Statistical Analysis**: Calculate min, max, total, and average |
| 15 | +- **Input Validation**: Verify data count and format integrity |
| 16 | +- **GUI Interface**: User-friendly file selection dialogs |
| 17 | +- **Sample Data**: Includes multiple test files (10-700 integers) |
| 18 | + |
| 19 | +## 📁 Input Format |
| 20 | + |
| 21 | +- First integer: count of following integers |
| 22 | +- Subsequent integers: data values (space or newline separated) |
| 23 | + |
| 24 | +## 📄 Output Format |
| 25 | + |
| 26 | +- Line 1: File size (count) |
| 27 | +- Lines 2-n: Data values (10 per line) |
| 28 | +- Final lines: Statistics (one per line) |
| 29 | + - Minimum value |
| 30 | + - Maximum value |
| 31 | + - Total sum |
| 32 | + - Average (2 decimal places) |
| 33 | + |
| 34 | +## 🚀 Quick Start |
| 35 | + |
| 36 | +### Using Maven (Recommended) |
10 | 37 |
|
11 | 38 | ```powershell |
12 | | -Push-Location "g:\My Drive\GITHUB\java\java_file_statistics_processor_gh" |
| 39 | +# Build the project |
| 40 | +mvn clean package |
| 41 | +
|
| 42 | +# Run the application |
| 43 | +java -jar target/file-statistics-processor-1.0.0.jar |
| 44 | +``` |
| 45 | + |
| 46 | +### Without Maven |
| 47 | + |
| 48 | +```powershell |
| 49 | +# Compile |
13 | 50 | javac FileStatisticsProcessor.java |
| 51 | +
|
| 52 | +# Run |
14 | 53 | java FileStatisticsProcessor |
15 | | -Pop-Location |
16 | 54 | ``` |
17 | 55 |
|
18 | | -## Sample Data |
| 56 | +## 📖 Usage |
| 57 | + |
| 58 | +1. Launch the application |
| 59 | +2. Select an input file (sample files available in `data/` directory) |
| 60 | +3. Choose output location and filename |
| 61 | +4. View processing summary dialog |
| 62 | +5. Check output file for formatted data and statistics |
| 63 | + |
| 64 | +## 📊 Sample Data |
| 65 | + |
| 66 | +The `data/` directory includes test files: |
| 67 | +- `Data - 10.txt` (10 integers) |
| 68 | +- `Data - 20.txt` (20 integers) |
| 69 | +- `Data - 50.txt` (50 integers) |
| 70 | +- `Data - 100.txt` (100 integers) |
| 71 | +- `Data - 200.txt` (200 integers) |
| 72 | +- `Data - 400.txt` (400 integers) |
| 73 | +- `Data - 600.txt` (600 integers) |
| 74 | +- `Data - 700.txt` (700 integers) |
| 75 | + |
| 76 | +## 📋 Requirements |
| 77 | + |
| 78 | +- **JDK 21** (Temurin recommended) |
| 79 | +- **Maven 3.9+** |
| 80 | + |
| 81 | +## 🏗️ Building from Source |
| 82 | + |
| 83 | +```powershell |
| 84 | +# Clone the repository |
| 85 | +git clone https://github.com/maxwell-hauser/java_file_statistics_processor.git |
| 86 | +cd java_file_statistics_processor |
| 87 | +
|
| 88 | +# Build with Maven |
| 89 | +mvn clean install |
| 90 | +
|
| 91 | +# Run tests |
| 92 | +mvn test |
| 93 | +``` |
| 94 | + |
| 95 | +## 📄 License |
| 96 | + |
| 97 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 98 | + |
| 99 | +## 👤 Author |
19 | 100 |
|
20 | | -Example files are in `data/`. Choose any of the `Data - *.txt` files as input. The output can be saved anywhere; if no extension is provided, `.txt` is appended automatically. |
| 101 | +**Maxwell Hauser** |
21 | 102 |
|
22 | | -## Notes |
| 103 | +## 🤝 Contributing |
23 | 104 |
|
24 | | -- The program validates the declared file size and reads exactly that many integers. |
25 | | -- Non-integer tokens or insufficient values will show an error dialog. |
26 | | -- Average is written with two decimal places. |
| 105 | +Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/maxwell-hauser/java_file_statistics_processor/issues). |
0 commit comments