#!/usr/bin/env ruby thresh = ARGV[1].to_f thresh ||= 0 File.readlines(ARGV[0]).each do |pred| smi,c,maxsim = pred.split(",") puts [smi,c].join(",") if maxsim.to_f > thresh end