summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2018-04-27 18:45:45 +0000
committerPatrick Simianer <p@simianer.de>2018-04-27 18:45:45 +0000
commit8e0ad499ebfd968b8b97fa412e8b43ac43f25e44 (patch)
treef59354f1a693c0f25451f396ceebd4d01559c209
parentf44539de04b178f3a1b14960407ec683030f927a (diff)
filter-len: more params
-rwxr-xr-xfilter-len7
1 files changed, 5 insertions, 2 deletions
diff --git a/filter-len b/filter-len
index c1ec9c1..fe45b57 100755
--- a/filter-len
+++ b/filter-len
@@ -4,14 +4,17 @@ require 'zipf'
a = ReadFile.new ARGV[0]
b = ReadFile.new ARGV[1]
-max = ARGV[2].to_i
+min = ARGV[2].to_i
+max = ARGV[3].to_i
a_out = WriteFile.new ARGV[0]+".out"
b_out = WriteFile.new ARGV[1]+".out"
while line = a.gets
line1 = b.gets
- if line.strip.split.size <= max and line1.strip.split.size <= max
+ len = line.strip.split.size
+ len1 = line1.strip.split.size
+ if len >= min and len1 >= min and len <= max and len1 <= max
a_out.write line
b_out.write line1
end