简体   繁体   English

使用 Ruby 将 CSV 导出到 Excel 的最简单方法是什么?

[英]What's the easiest way to export a CSV to Excel with Ruby?

I'm using Ruby 1.9 for this.我为此使用 Ruby 1.9。 I need to convert Ruby arrays into a Excel spreadsheet document (xls).我需要将 Ruby arrays 转换为 Excel 电子表格文档 (xls)。

I use two gems to export to Excel-readable formats: Spreadsheet (can create/parse.xls) and FasterCSV (faster, but as far as I can remember doesn't work with.xls files)我使用两个 gem 导出为 Excel 可读格式:电子表格(可以创建/解析.xls)和FasterCSV (更快,但据我记得不适用于 .xls 文件)

I've had excellent results with WriteExcel (which is a Ruby port of a Perl library of the same name).我使用WriteExcel (它是同名的 Perl 库的 Ruby 端口)取得了出色的成绩。

Csv files would be the fastest if you just want to export values如果您只想导出值, Csv文件将是最快的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Ruby中从CSV文件获取头文件的最简单方法是什么? - What's the easiest way to get the headers from a CSV file in Ruby? 在 Ruby 中,在字符串的开头而不是结尾处“chomp”的最简单方法是什么? - In Ruby, what's the easiest way to “chomp” at the start of a string instead of the end? 使用Ruby通过Outlook发送消息的最简单方法是什么? - What's the easiest way to send a message through Outlook with Ruby? 在本地设置红宝石/铁轨沙箱的最简单方法是什么? - what's the easiest way to setup a ruby/rails sandbox locally? 在Ruby on Rails中导出为CSV和Excel - Export as CSV and Excel in Ruby on Rails 在我的服务器上安装 Ruby 的最简单方法是什么 - What is the easiest way to install Ruby on my server 我很困惑,在OS X上安装Ruby 1.9.2的最简单方法是什么? - I'm confused, what's the easiest way to install Ruby 1.9.2 on OS X? 在没有混淆输出的情况下,在Ruby中从并行操作打印输出的最简单方法是什么? - What's the easiest way to print output from parallel operations in Ruby without jumbling up the output? 在Ruby中获取Lisp样式加法(+ * args)的最简单方法是什么? - What's the easiest way to get Lisp-Style addition (+ *args) in Ruby? 在ActiveResource中使用OAuth的最简单方法是什么? - What's the easiest way to use OAuth with ActiveResource?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM