0

What's the command which is used to remove every fourth line in a file? As these lines contain garbled characters.

anilhr2learn
  • 31
  • 1
  • 3
  • 1
    Possible duplicate of [How can I delete every Xth line in a text file?](https://stackoverflow.com/questions/9894986/how-can-i-delete-every-xth-line-in-a-text-file) – Aserre Dec 01 '17 at 08:56

1 Answers1

1

Try this.

awk 'NR%4 != 0'  filename
Kaushik Nayak
  • 30,772
  • 5
  • 32
  • 45