I can write/read the csv file by my ruby script.
But how to mark color on the csv output content.
Let it easy to read.
···
--
Posted via http://www.ruby-forum.com/.
I can write/read the csv file by my ruby script.
But how to mark color on the csv output content.
Let it easy to read.
--
Posted via http://www.ruby-forum.com/.
If you mean the console, take a look at: http://ascii85.rubyforge.org/
On Thu, May 26, 2011 at 7:57 AM, Gavin Chen <dickyhide@gmail.com> wrote:
I can write/read the csv file by my ruby script.
But how to mark color on the csv output content.
Let it easy to read.
--
Phillip Gawlowski
A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
-- Leibnitz
require 'fastercsv'
FasterCSV.parse(my_string, :headers => true) do |row|
Fruit.create!(
:name => row['name'],
:color => row['color'],
:tasty => row['tasty'] == 'true',
:qty => row['qty].to_i
)
end
For Ruby 1.9, just rename FasterCSV to CSV and fastercsv to csv:
require 'csv'
CSV.parse(my_string, :headers => true) do |row|
# same as ruby-1.8
end
so you must need fastercsv gem if you install then it is possible
bye
--
Posted via http://www.ruby-forum.com/.
Phillip Gawlowski wrote in post #1001125:
On Thu, May 26, 2011 at 7:57 AM, Gavin Chen <dickyhide@gmail.com> wrote:
I can write/read the csv file by my ruby script.
But how to mark color on the csv output content.
Let it easy to read.
If you mean the console, take a look at: http://ascii85.rubyforge.org/
--
Phillip GawlowskiA method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
-- Leibnitz
Thanks,
But not on the console.
I parser some data and output file is .csv.
On the csv file (open by excel) I want to use color to mark some
cell.
Does can work?
--
Posted via http://www.ruby-forum.com/\.
No: RFC 4180 - Common Format and MIME Type for Comma-Separated Values (CSV) Files
You'd've to create a spreadsheet for that, and maybe the spreadsheet
gem can pull that off for you (I haven't used it). If you are certain
that the Excel installation being used can read ODF files, you can try
[Open|Libre]Office's spreadsheet format (Though, AFAIK, Excel versions
before 2007 require a plugin for that), or create an Excel
spreadsheet.
On Thu, May 26, 2011 at 9:07 AM, Gavin Chen <dickyhide@gmail.com> wrote:
On the csv file (open by excel) I want to use color to mark some
cell.
Does can work?
--
Phillip Gawlowski
A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
-- Leibnitz