From cf0bf046e51a4a76315b8c964fabc8e641eb91fe Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Wed, 7 Jan 2015 18:47:50 +0100 Subject: select_from, max_len --- max_len | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 max_len (limited to 'max_len') diff --git a/max_len b/max_len new file mode 100755 index 0000000..69013b5 --- /dev/null +++ b/max_len @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +require 'zipf' + +max = ARGV[0].to_i + +i = 0 +while line = STDIN.gets + if tokenize(line).size <= max + puts i + else + STDERR.write line + end + i += 1 +end + -- cgit v1.2.3