Created
May 6, 2013 07:42
-
-
Save jph/5523842 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
csv = CSV.read "ips.csv" | |
config = [] | |
csv.each_with_index do |row,index| | |
config << "Dest#{index}=#{row[0].gsub(/ /,'')}-#{row[3].gsub(/ /,'')}-#{row[2]}" | |
end | |
puts config.join "\r\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
csv = CSV.read "ips.csv" | |
hosts = [] | |
csv.each do |row| | |
hosts << "#{row[1]} #{row[0].gsub(/ /,'')}-#{row[3]}-#{row[2]}" | |
end | |
puts hosts.join "\r\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment