Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
read CSV file using csv library
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Frank Guerino" data-source="post: 4650157"><p>Hi Marvin,</p><p></p><p>Thanks for the quick reply. I installed fastercsv using the command you</p><p>described and there were no issues, so it seems to have installed</p><p>propertly.</p><p></p><p>Next, I wrote the following code:</p><p></p><p>require "rubygems"</p><p>csvData = FasterCSV.read("./dataInput3.csv")</p><p>myString = csvData[0][0]</p><p>puts myString</p><p></p><p></p><p>When I run "ruby -cw fasterCSV.rb" I get syntax ok.</p><p>However, when I run the script I get an error that states "uninitialized</p><p>constant FasterCSV (NameError)"</p><p></p><p>Is there anything special I need to do to initialize the class?</p><p></p><p>Thanks,</p><p></p><p>Frank</p></blockquote><p></p>
[QUOTE="Frank Guerino, post: 4650157"] Hi Marvin, Thanks for the quick reply. I installed fastercsv using the command you described and there were no issues, so it seems to have installed propertly. Next, I wrote the following code: require "rubygems" csvData = FasterCSV.read("./dataInput3.csv") myString = csvData[0][0] puts myString When I run "ruby -cw fasterCSV.rb" I get syntax ok. However, when I run the script I get an error that states "uninitialized constant FasterCSV (NameError)" Is there anything special I need to do to initialize the class? Thanks, Frank [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
read CSV file using csv library
Top