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="kranthi reddy" data-source="post: 4613215"><p>[Note: parts of this message were removed to make it a legal post.]</p><p></p><p>Hi,</p><p>To use faster csv you need to install the gem called fastercsv.</p><p>Then you can do the following</p><p></p><p>data = FasterCSV.read("/root/Desktop/<name of the csv file>" )</p><p>From this data you can access the columns the way you wish.</p><p>data[0][0] gives you the first column of the first row likewise you can get</p><p>the other rows also.</p><p>If you want to get the data for the entire column you can loop through and</p><p>get the details.</p><p>If you have any queries feel free to ask me .</p><p>kranthi.</p></blockquote><p></p>
[QUOTE="kranthi reddy, post: 4613215"] [Note: parts of this message were removed to make it a legal post.] Hi, To use faster csv you need to install the gem called fastercsv. Then you can do the following data = FasterCSV.read("/root/Desktop/<name of the csv file>" ) From this data you can access the columns the way you wish. data[0][0] gives you the first column of the first row likewise you can get the other rows also. If you want to get the data for the entire column you can loop through and get the details. If you have any queries feel free to ask me . kranthi. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
read CSV file using csv library
Top