This is a simple text editor program implemented in C++. It allows users to enter and manipulate text, read from and write to files, and search for specific text within the buffer.
- Enter and edit text
- Create new lines
- Read from files
- Save text to files
- Search for text within the buffer
- Clone the repository or download the source code.
- Ensure you have a C++ compiler installed (e.g., GCC).
- Compile the program using the following command:
g++ main.cpp -o text_editor
Run the compiled program:
./text_editor
You will be prompted to enter commands to interact with the program.
The program supports the following commands:
-
Enter Text
- Command:
1
- Description: Allows you to enter text. Input ends when you press
Enter
.
- Command:
-
Create New Line
- Command:
2
- Description: Creates a new line in the buffer.
- Command:
-
Read from File
- Command:
3
- Description: Reads text from a specified file.
- Input: Enter the name of the file.
- Command:
-
Save to File
- Command:
4
- Description: Saves the current buffer content to a specified file.
- Input: Enter the name of the file.
- Command:
-
Search Text
- Command:
5
- Description: Searches for specified text within the buffer.
- Input: Enter the text to search for.
- Command:
-
Exit Program
- Command:
6
- Description: Exits the program.
- Command:
Enter your command:
1
Enter the text:
Hello, World!
2
New line was created
4
Enter the name of the file:
output.txt
Text saved to output.txt
6
Exiting the program...
This project is licensed under the MIT License. See the LICENSE
file for details.
You can save this content to a file named README.md
. Here is the code to do so: