Skip to content

Instantly share code, notes, and snippets.

@etdsoft
Created November 1, 2013 23:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etdsoft/7273325 to your computer and use it in GitHub Desktop.
Save etdsoft/7273325 to your computer and use it in GitHub Desktop.
CSV to Textile table
require 'csv'
if ARGV.count != 1
puts "Usage:\n\t#{$0} <file.csv>"
exit 1
end
file = ARGV.first
if !File.exist?(file)
puts "File not found: #{file}"
exit 2
end
CSV.foreach(file) do |row|
puts "|#{row.join('|')}|"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment