hetzner csv 2 table

This commit is contained in:
2016-05-17 16:00:50 +02:00
parent 57e5470f1b
commit 181b28679a
3 changed files with 40 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
#!/usr/bin/ruby
#
require 'csv'
#first File are the domains
domains = CSV.read(ARGV[0], {:col_sep => ";"})
#handles
#
handles = CSV.read(ARGV[1], {:col_sep => ";"})
thead_d = domains.shift
thead_h = handles.shift
thead = thead_d.values_at(0,2) + thead_h.values_at(5,6,7,14)
puts "|_."+thead.join("|_.")+"|"
everything = []
domains.each { |domain|
handles.each { |handle|
idx = handle.index(domain[3])
if(idx)
e_row = domain.values_at(0,2) + handle.values_at(5,6,7,14)
everything << e_row
puts "|"+(e_row).join("|")+"|"
end
}
}