Sha256: ad85a9f5dad4d479ec0a50ce2419b1af52fa6b74fa0101fdb84544a903a2a74a
Contents?: true
Size: 414 Bytes
Versions: 74
Compression:
Stored size: 414 Bytes
Contents
#!/usr/bin/env ruby require 'socket' host = 'localhost' port = 4334 f = open('10000_names.txt') w = open('output.txt', 'w') s = TCPSocket.open(host, port) f.each_with_index do |line, i| puts i if i % 1000 == 0 line = line.strip s.puts(line.strip) res = s.gets if res && res.split(" ").size > 3 res = res.strip w.write(line + "\n") w.write(res + "\n") w.write("\n") end end s.close
Version data entries
74 entries across 74 versions & 2 rubygems