Skip to content

Instantly share code, notes, and snippets.

@kenmickles
Last active August 29, 2015 14:08
Show Gist options
  • Save kenmickles/d3779be73fa29dff14d2 to your computer and use it in GitHub Desktop.
Save kenmickles/d3779be73fa29dff14d2 to your computer and use it in GitHub Desktop.
Format a .CSV export from Google Docs for SUGARfx Rolling Credits
require 'csv'
CSV.read("credits.csv").each_with_index do |line, i|
line.each { |s| s.gsub!("'", "’") unless s.nil? }
if i == 0
puts "[TTL]#{line[0].upcase!}"
elsif line.compact.length > 0
puts "\n" if line[0]
line[1].upcase! if line[1]
puts line.join(' * ').strip
else
puts "\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment