maidinhtai
asked on
Very simple: delete a line or a string at a line in a text file
For example, I have a text file:
-------------------------- -
This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
This is line 6
--------------------------
And I want to delete line4. Then the content of the text file will be:
-------------------------- -
This is line 1
This is line 2
This is line 3
This is line 5
This is line 6
--------------------------
And I want to replace the string "line 5" at line 4 with the string "line 4" . The content of the text file will be:
-------------------------- -
This is line 1
This is line 2
This is line 3
This is line 4
This is line 6
--------------------------
Thank you.
--------------------------
This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
This is line 6
--------------------------
And I want to delete line4. Then the content of the text file will be:
--------------------------
This is line 1
This is line 2
This is line 3
This is line 5
This is line 6
--------------------------
And I want to replace the string "line 5" at line 4 with the string "line 4" . The content of the text file will be:
--------------------------
This is line 1
This is line 2
This is line 3
This is line 4
This is line 6
--------------------------
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:-)