comma-csv / comma

Comma is a small CSV (ie. comma separated values) generation extension for Ruby objects, that lets you seamlessly define a CSV output format via a small DSL

Home Page:https://github.com/comma-csv/comma

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to change the delimiter character to something other than a comma?

tboyko opened this issue · comments

For instance, how can I output TSV (tab-separated) instead?

Hi,

Yes, as mentioned in the README, you can apply any CSV options available for use with the Ruby library :
http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html

For example :

Book.limited(10).to_comma(:col_sep      => '\t')

Cheers,

Tom

Missed that. Thanks!

On Mar 8, 2013, at 8:13 PM, Tom Meier notifications@github.com wrote:

Hi,

Yes, as mentioned in the README, you can apply any CSV options available for use with the Ruby library :
http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html

For example :

Book.limited(10).to_comma(:col_sep => '\t')
Cheers,

Tom


Reply to this email directly or view it on GitHub.

For the reference of others, the correct syntax requires double quotes:

Book.limited(10).to_comma(:col_sep => "\t")