-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Ara.T.Howard wrote: > 3 please! i have this in almost ALL my code: > > require 'csv' > require 'arrayfields' > > class SomeTable < ::Array > def initialize path > header = nil > CSV::parse(path) do |row| > header ||= row > self << row > end > self.fields = fields > end > end > > and whammo - keywords access to cells. it make using csv infinitely > easier. Interesting. Do you have any idea how API should be? # rambling reader = CSV::Reader.create(STDIN) reader.set_initial_row_as_a_column_header = true # ??? reader.each do |row| p row[:name], row[:age] end reader.close CSV.parse_with_initial_row_as_a_column_header(STDIN) do |row| ... end CSV.parse_with_specified_colname(STDIN, [:name, :dept, :age]) do |row| p row[:name], row[:age] end ... Regards, // NaHi -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Cygwin) iD8DBQFDZZIXf6b33ts2dPkRAoACAKDHJ5D9FJ6IrvBNQ0ZN7zw/LVldwgCgnRCp y7re9hnX1zFJQ/u9UntB4v8= =yx/3 -----END PGP SIGNATURE-----