Created
March 16, 2014 07:51
-
-
Save ik5/9579863 to your computer and use it in GitHub Desktop.
Hetz request to compare two files with different lengths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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