diff options
Diffstat (limited to 'select_from')
-rwxr-xr-x | select_from | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/select_from b/select_from new file mode 100755 index 0000000..14fbc9e --- /dev/null +++ b/select_from @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +require 'zipf' + +accept = {} + +f = ReadFile.new ARGV[0] +f.readlines_strip.each { |line| + accept[line.strip.to_i] = true +} + +i = 0 +while line = STDIN.gets + if accept[i] + STDOUT.write line + end + i += 1 +end + |