How to remove a particular line in a file?
Solved/Closed
Related:
- How to remove a particular line in a file?
- Windows 10 iso file download 64-bit - Download - Windows
- Kmspico zip file download - Download - Other
- How to open a local file on iphone - Guide
- How to remove a number from blacklist - Guide
- Windows defender can't remove threat ✓ - Viruses & Security Forum
4 responses
Here is the documentation. https://www.gnu.org/software/sed/manual/sed.pdf
PLease forgive me, I have not used it, but it is close syntax to DOS. Your scope of the question is not direct, you will have to figure out what this model is, and apply your problem to this model. I am not gong to give you the exact code to make it work, as you have asked for a particular line, and the example has it in there.
This should be deleting line 2 and inserting --end--. Once again, not tested.
PLease forgive me, I have not used it, but it is close syntax to DOS. Your scope of the question is not direct, you will have to figure out what this model is, and apply your problem to this model. I am not gong to give you the exact code to make it work, as you have asked for a particular line, and the example has it in there.
$ sed '2d a\--end--' input.txt > output.txt
This should be deleting line 2 and inserting --end--. Once again, not tested.
Aug 24, 2018 at 07:07 AM