Advertisement
Guest User

Untitled

a guest
Jan 8th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.29 KB | None | 0 0
  1.   5 file = File.open(in_file, "r")
  2.   6 cont = file.read
  3.   7
  4.   8 ips = cont.scan(/\d+\.\d+\.\d+\.\d+/)
  5.   9 ips.map {|entry| 'https://'+entry.to_s }
  6.  10
  7.  11 out_file = File.new(out_file, "w")
  8.  12 out_file.write(ips.uniq.join("\n"))
  9.  
  10.  
  11. outpute file :
  12. 1.2.3.4
  13. 2.3.4.5
  14.  
  15. need -
  16. https://1.2.3.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement