Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- input = open('input.txt').map {|e| [e.split[0], e] }
- open('list.txt').map {|e|
- e.strip!
- ([e] + input.select {|_, li| li.include? e }.map {|id, _| id })
- .join "\t"
- }.join("\n").tap {|e| open('output.txt', 'w') {|f| f.puts e } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement