CSV headers and time conversion

R

Ronald Steckly

[Note: parts of this message were removed to make it a legal post.]

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
 
J

James Gray

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

No worries, we'll fix you up=85
I've read the FasterCSV docs and, for the life of me, can't figure =20
out how to return values by header. Here's the script:

require 'rubygems'
require 'fastercsv'

a=3DFasterCSV.table("\/Users\/ron\/snlusgam.csv").by_col

b=3Da.['header_name']

b =3D a[:header_name]

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

Hope that helps.

James Edward Gray II=
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,289
Messages
2,571,435
Members
48,121
Latest member
ColinHibne

Latest Threads

Top