I need to delete every 3rd and 5th line except the 15th line in a text file using sed. Has someone an idea?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
Try next command. You will need the GNU version of
First check if line is 15th: print and read next one. Otherwise, delete every 3rd line and every 5th line starting with first one. |
|||
|
|
|
It's much easy if you use
|
|||||
|