There are many possible solutions to the problem. With awk
, the following line fits the requirements:
awk '{if ((NR+2) % 4 == 0) print $0}'
Test:
$ cat test.txt
@ATDGGSGDTSG
NTCCCCC
+
nddhdhnadn
@ATDGGSGDTSG
NTCCCCC
+
nddhdhnadn
$ awk '{if ((NR+2) % 4 == 0) print $0}' test.txt
NTCCCCC
NTCCCCC
It displays every 4th line starting from line 2 (because the logical expression ((NR+2) % 4 == 0 is true, where NR contains the actual row number).
If your input happens to have these empty lines in between, then the problem is about displaying the 3rd line and then every 8th.
awk '{if ((NR+5) % 8 == 0) print $0}'