Using C++ On Linux, run the command:
ed <input.txt
The output obtained should be the same as the out.txt file You must write an editor program that if we run it:
a.out <input.txt
We will get the same output as the out.txt file
prints line number of current line followed by TAB followed by current line
prints all lines (ed maintains a current line)
makes line #number the current line a appends new text after the current line
Connect row number1 and row number2 to one row. The current row is number1 , the number of rows in a small file is 1.
inserts new text before the current line
changes the current line for text that follows
deletes the current line
searches forward after current line for the specified text
searches backward
replaces old string with new in current line (google: C++ split or token)
Quits the editor without saving