Skip to content

Instantly share code, notes, and snippets.

@ktym
Created March 7, 2018 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktym/edd6b1284c2ebef7df5f0d41c51c4069 to your computer and use it in GitHub Desktop.
Save ktym/edd6b1284c2ebef7df5f0d41c51c4069 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'json'
uniq = File.open("uniq_node.txt").map {|x| x.stip.to_i}
json = JSON.parse(ARGF.read)
json.each do |ary|
read_id = ary.shift
uniq.each do |uniq_id|
size = ary.select { |node_id| node_id == uniq_id }.size
if size > 0
p read_id, uniq_id
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment