Last active
August 29, 2015 14:08
-
-
Save kenmickles/d3779be73fa29dff14d2 to your computer and use it in GitHub Desktop.
Format a .CSV export from Google Docs for SUGARfx Rolling Credits
This file contains 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.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