Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sgoodwin/322070 to your computer and use it in GitHub Desktop.
Save sgoodwin/322070 to your computer and use it in GitHub Desktop.
CSV -> Plist
require 'CSV'
require 'plist'
file = File.open('somecsv.csv')
list = CSV.parse(file.read)
1.upto(list.count) do |row|
if(!list[row].nil?)
hash[list[row][0]] = list[row][1]
end
end
doc = hash.to_plist
local_filename = "output.plist"
File.open(local_filename, 'w') {|f| f.write(doc) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment