Skip to content

Instantly share code, notes, and snippets.

@crispgm
Last active December 17, 2018 09:31
Show Gist options
  • Save crispgm/c9c2dd384b44f243b73e97248cc8b1a0 to your computer and use it in GitHub Desktop.
Save crispgm/c9c2dd384b44f243b73e97248cc8b1a0 to your computer and use it in GitHub Desktop.
Random sample from a file with awk
awk 'BEGIN {srand()} !/^$/ { if (rand() <= .01) print $0}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment