|
| 1 | +# 🔢 dec2ascii 🔤 |
| 2 | + |
| 3 | +**dec2ascii** is a command-line tool for converting decimal numbers to ASCII text. It can read decimal numbers from the command-line arguments or from a file, and can write the output to the console or to a file. It's written in [Go](https://golang.org/) and can be compiled to run on various operating systems. |
| 4 | + |
| 5 | +## 🚀 Getting Started |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +To compile and run **dec2ascii**, you need to have [Go](https://golang.org/) installed on your system. You can download and install Go from the official website: https://golang.org/dl/ |
| 10 | + |
| 11 | +## 🐹 Installation |
| 12 | + |
| 13 | +1. Clone this repository: |
| 14 | +```bash |
| 15 | +git clone https://github.com/your-username/dec2ascii.git |
| 16 | +``` |
| 17 | +2. Navigate to the project directory: |
| 18 | +```bash |
| 19 | +cd dec2ascii |
| 20 | +``` |
| 21 | + |
| 22 | +3. Compile the source code: |
| 23 | +```bash |
| 24 | +go build -o dec2ascii main.go |
| 25 | +``` |
| 26 | + |
| 27 | +OR |
| 28 | + |
| 29 | +## 💾 Makefile |
| 30 | + |
| 31 | +`dec2ascii` comes with a Makefile to simplify building and installing the program. Here are the available Makefile targets: |
| 32 | + |
| 33 | +- `build` - Compiles the `dec2ascii` program. |
| 34 | +- `install` - Compiles and installs the `dec2ascii` program. |
| 35 | +- `clean` - Cleans up the build artifacts. |
| 36 | + |
| 37 | +To build and install `dec2ascii`, simply run the following command: |
| 38 | +```bash |
| 39 | + sudo make install |
| 40 | +``` |
| 41 | + |
| 42 | +This will compile the program and install it to the system-wide `bin` directory (`/usr/local/bin` by default). |
| 43 | + |
| 44 | +To customize the installation directory, modify the `INSTALL_DIR` variable in the Makefile. |
| 45 | + |
| 46 | +Note that the `install` target requires root privileges, as it installs the executable to the system-wide `bin` directory. |
| 47 | + |
| 48 | + |
| 49 | +### Usage |
| 50 | +```bash |
| 51 | +dec2ascii [-i input-file] [-o output-file] |
| 52 | +dec2ascii decimal-numbers |
| 53 | +``` |
| 54 | +Here's an overview of the command-line arguments: |
| 55 | +```bash |
| 56 | +-i input-file: specify an input file to read decimal numbers from |
| 57 | + |
| 58 | +-o output-file: specify an output file to write the converted text to |
| 59 | + |
| 60 | +decimal-numbers...: one or more decimal numbers to convert to ASCII text |
| 61 | +``` |
| 62 | +### If the `-i` flag is not specified, the program will read decimal numbers from the command-line arguments. If the `-o` flag is not specified, the program will print the converted text to the console. |
| 63 | + |
| 64 | +<br> |
| 65 | + |
| 66 | +# 💡 Examples |
| 67 | + |
| 68 | +Here are some examples of how to use **dec2ascii**: |
| 69 | + |
| 70 | +### Convert decimal numbers from the command-line |
| 71 | +```bash |
| 72 | +dec2ascii 72 101 108 108 111 32 87 111 114 108 100 |
| 73 | +``` |
| 74 | + |
| 75 | + |
| 76 | +This will print the ASCII text equivalent of the decimal numbers to the console: |
| 77 | +```bash |
| 78 | +Hello World |
| 79 | +``` |
| 80 | + |
| 81 | + |
| 82 | +### Convert decimal numbers from a file and write the output to a file |
| 83 | + |
| 84 | + |
| 85 | +This will read the decimal numbers from the `input.txt` file and write the converted text to the `output.txt` file. |
| 86 | + |
| 87 | +```bash |
| 88 | +dec2ascii -i input.txt -o output.txt |
| 89 | +``` |
| 90 | +This will read the decimal numbers from the `input.txt` file and write the converted text to the `output.txt` file. |
| 91 | + |
| 92 | +## 📝 License |
| 93 | + |
| 94 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments