Copyright 2006 Gray Productions. All rights reserved.
This file is just another name for faster_csv.rb.
require “faster_csv”
csvdata = “jones,bob,165\n”
csvdata = “smith,tim,10\n”
csvdata = “doe,john,155\n”
lastname, firstname, iq = “”
fastercsv.parse(csvdata) do |row |
lastname, firstname, iq = *row
puts “#{firstname} #{lastname} has an IQ of #{iq}”
end
I am using Netbeans and I got the following message:
C:/NetBeansProjects/Fastercsv/lib/main.rb:17: undefined local variable
or method `fastercsv’ for main:Object (NameError)
fastercsv.parse(csvdata) do |row |
one = *row
end
thufir@arrakis ~/csv $
thufir@arrakis ~/csv $ mysql -u root -ppassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.0.44-log Gentoo Linux mysql-5.0.44
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> DESCRIBE csv_data.one;
±------±--------±-----±----±--------±------+
| Field | Type | Null | Key | Default | Extra |
±------±--------±-----±----±--------±------+
| one | int(11) | YES | | NULL | |
±------±--------±-----±----±--------±------+
1 row in set (0.26 sec)