# CSV headers and time conversion

**URL:** <https://www.ruby-forum.com/t/csv-headers-and-time-conversion/133626>\
**Category:** Ruby\
**Created:** [April 2, 2008, 4:11am UTC](https://www.ruby-forum.com/t/csv-headers-and-time-conversion/133626 "2008-04-02T04:11:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronald\_Steckly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Ronald\_Steckly](https://www.ruby-forum.com/u/Ronald_Steckly)\
**Post date:** [April 2, 2008, 4:11am UTC](https://www.ruby-forum.com/t/csv-headers-and-time-conversion/133626/1 "2008-04-02T04:11:29Z")

</div>

Hi,

So maybe I spoke too soon when I said I had the csv part of this  
handled.  
I’ve read the FasterCSV docs and, for the life of me, can’t figure out  
how  
to return values by header. Here’s the script:

require ‘rubygems’  
require ‘fastercsv’

a=FasterCSV.table("/Users/ron/snlusgam.csv").by\_col

b=a.[‘header\_name’]

puts b

I know this isn’t right, but I can’t seem to find in the documentation  
how  
to return an array of values from a particular column header.

Has anybody done this?

Thanks,

Ron

---

<div class="post-metadata">

**Author:** ![Ronald\_Steckly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Ronald\_Steckly](https://www.ruby-forum.com/u/Ronald_Steckly)\
**Post date:** [April 2, 2008, 5:12am UTC](https://www.ruby-forum.com/t/csv-headers-and-time-conversion/133626/2 "2008-04-02T05:12:11Z")

</div>

On Apr 1, 2008, at 9:10 PM, Ronald Steckly wrote:

> So maybe I spoke too soon when I said I had the csv part of this  
> handled.

No worries, we’ll fix you up…

> I’ve read the FasterCSV docs and, for the life of me, can’t figure  
> out how to return values by header. Here’s the script:
> 
> require ‘rubygems’  
> require ‘fastercsv’
> 
> a=FasterCSV.table("/Users/ron/snlusgam.csv").by\_col
> 
> b=a.[‘header\_name’]

b = a[:header\_name]

> puts b

By default, table() converts field names to Symbols for super easy  
access.

Hope that helps.

James Edward G. II
