2010/7/1 Robert Klemme <shortcutter / googlemail.com>:
> 2010/7/1 James Edward Gray II <james / graysoftinc.com>:
>> On Jun 30, 2010, at 10:41 AM, Brian Candler wrote:
>>
>>> James Edward Gray II wrote:
>>>> I'm open to suggestions and I do take patches.
>>>
>>> Specifically, I'd like to see how to parse CSV from stdin. You provide
>>> an example in the opposite direction:
>>>
>>> # =A0 FCSV($stderr) =A0 =A0{ |csv_err| csv_err << %w{my data here} } =
=A0# to
>>> $stderr
>>
>> On Jun 30, 2010, at 11:35 AM, Robert Klemme wrote:
>>
>>> On 30.06.2010 17:05, James Edward Gray II wrote:
>>>>
>>>> Do you think it would help if I added Wrapping an IO under the
>>>> Shortcut Interface on this page?
>>>>
>>>> http://fastercsv.rubyforge.org/classes/FasterCSV.html
>>>
>>> +1
>>
>> Better?
>>
>> http://fastercsv.rubyforge.org/classes/FasterCSV.html
>
> Perfect! =A0Do you think it is a good idea to also allow an IO as
> argument to foreach so we can save a block?
>
> FCSV($stdin) =A0 =A0 { |csv_in| =A0csv_in.each { |row| p row } } =A0# fro=
m $stdin
>
> would become
>
> FCSV.foreach($stdin) =A0 =A0 { |row| p row } =A0# from $stdin

Btw, this inspired me to http://gist.github.com/459749

:-)

Cheers

robert


--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/