Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Parsing csv file to ods file format
2 Posts
Parsing csv file to ods file format

Hi All, Recently I came across a new task to be implemented in Rails.I have a bunch of csv files for my project .I want to convert the csv files to ODS(Open Office - Open Data Spreadsheet) format.Currently I have used 2 plugins meant for ODS support namely roo- which reads ODS files and rodf- which writes to an ODS files.

Can any one help me out with any reference or plugin for converting csv to ODS?

Also in the later stage of development I would like to convert the parser function in to a new rake task so that I can run rake for converting csv to ODS.

Thank You Narayan

Read the CSV file and then write the content you want to ODS.

require 'csv'

CSV::Reader.parse(File.open('file.csv', 'r'), ';') do |row|
  #write to ODS :)
2 Posts
Login to add your message