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="Marvin Gülker" data-source="post: 4650158"><p>Frank Guerino wrote:</p><p>Is there anything special I need to do to initialize the class?</p><p></p><p>You only required the rubygems library wich is necassary to load Gems</p><p>(the packages you can install via RubyGems). So, you need to require</p><p>fastercsv, too.</p><p></p><p>require "rubygems"</p><p>require "fastercsv"</p><p>csvData = FasterCSV.read("./dataInput3.csv")</p><p>myString = csvData[0][0]</p><p>puts myString</p><p></p><p></p><p>Btw. the documentation for fastercsv should have been installed along</p><p>with the Gem, it should reside in the</p><p>lib/ruby/gems/<RUBY_VERSION>/doc/fastercsv subdirectory of your Ruby</p><p>installation. But if you're satisfied with the command-line docs, type</p><p>$ ri FasterCSV</p><p></p><p>Have fun!</p><p></p><p>Marvin</p></blockquote><p></p>
[QUOTE="Marvin Gülker, post: 4650158"] Frank Guerino wrote: Is there anything special I need to do to initialize the class? You only required the rubygems library wich is necassary to load Gems (the packages you can install via RubyGems). So, you need to require fastercsv, too. require "rubygems" require "fastercsv" csvData = FasterCSV.read("./dataInput3.csv") myString = csvData[0][0] puts myString Btw. the documentation for fastercsv should have been installed along with the Gem, it should reside in the lib/ruby/gems/<RUBY_VERSION>/doc/fastercsv subdirectory of your Ruby installation. But if you're satisfied with the command-line docs, type $ ri FasterCSV Have fun! Marvin [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
read CSV file using csv library
Top