#!/usr/bin/awk # fournit un échantillon du fichier BEGIN{ if(ARGC != 3){ print ARGV[0] ": usage <%sample> " exit } sample = ARGV[1] / 100; ARGV[1] = ARGV[2]; #print "sample :" sample ARGC --; srand(0); } /\#/ {next;} # ignorer les commentaires { if(rand() < sample) print; }