hetzner csv 2 table
This commit is contained in:
28
Hetzner_Domains_Handles_CSV_to_Redmine_Table.rb
Executable file
28
Hetzner_Domains_Handles_CSV_to_Redmine_Table.rb
Executable 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user