Monday, July 9, 2012

[Rails] how to read and write to a same CSV file using JRuby

I'm working with Marathonite and JRuby, and there is a requirement to modify a csv file at the run time.

For example: Say the csv file looks like below:
test_name, status
test01, 0
test02, 0
test03, 0

I want read each line and update the status of each of these rows to 1, line by line. How can this be done (using JRuby)? If it is not possible for csv file, are there any methods that would work for any other file types?

Thanks 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/WArgvS2XL44J.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate