I am using a sed statement to print every nth line. In the example below, I am printing every 15th line starting at line 15.
What if I want to print every 150th line? Is there a way in awk or sed to not have to type out all the n's? It would not be practical to type 149 n's.
sed -n '15,${p;n;n;n;n;n;n;n;n;n;n;n;n;n;n;}' FILE
What if I want to print every 150th line? Is there a way in awk or sed to not have to type out all the n's? It would not be practical to type 149 n's.
sed -n '15,${p;n;n;n;n;n;n;n;n;n;n;n;n;n;n;}' FILE