Link to home
Start Free TrialLog in
Avatar of maidinhtai
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.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)