Search code examples
linuxbashterminalidl

exctract n rows every i rows


I am quite new in the data analysis field. I have a very big data file which contains millions of rows but repeated in the same patterns (100 steps time). I need to extract blocks formed by 100 rows every 10000 rows. In this way I would discard same useless data.

Thank you in advance


Solution

  • awk to the rescue!

    $ awk '(NR-1)%10000<100'