Skip to content

Instantly share code, notes, and snippets.

@ik5
Created March 16, 2014 07:51
Show Gist options
  • Save ik5/9579863 to your computer and use it in GitHub Desktop.
Save ik5/9579863 to your computer and use it in GitHub Desktop.
Hetz request to compare two files with different lengths
#!/usr/bin/env ruby
output = open('output', 'w+')
lines = open('logfile').readlines
open('shortfile').each_line do |l|
name = l.chomp
output.puts name if lines.include? name
end
output.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment