This program reads content from a file named input.txt
, formats it by appending a space after each line, and then outputs the formatted content into a new file called Formatted.txt
. Additionally, it prints the formatted content to the console. This simple utility is particularly useful for basic text manipulation where consistent spacing is needed.
- File Reading: Efficiently reads lines from
input.txt
. - Content Formatting: Adds a space after each line read from the input file.
- File Writing: Outputs the formatted content into
Formatted.txt
. - Console Output: Prints the formatted content to the console for immediate verification.
After compiling the program, ensure that you have an input.txt
file in the same directory as your executable. The program will read this file, format its contents, and output the result to both Formatted.txt
and the console.
- Input file:
input.txt
- Output file:
Formatted.txt
- File Not Opening: Ensure both
input.txt
andFormatted.txt
are not being used by another program. - Compilation Errors: Make sure your C++ compiler is correctly installed and your command path is properly set.
Contributions to enhance the functionality of this program are welcome. Please follow the standard process:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/NewFeature
). - Commit your changes (
git commit -am 'Add some NewFeature'
). - Push to the branch (
git push origin feature/NewFeature
). - Open a Pull Request.