将受密码保护的 xlsx 工作簿导入 R [英] Import password-protected xlsx workbook into R

查看:58
本文介绍了将受密码保护的 xlsx 工作簿导入 R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将工作表从受密码保护的 xlsx 工作簿导入 R?

How can I import a worksheet from a password-protected xlsx workbook into R?

我希望能够将 Excel 工作表转换为 csv 文件,而无需通过 Excel 本身.

I would like to be able to convert an Excel worksheet into a csv file without having to go through Excel itself.

xls 工作簿可以使用包 gdata 中基于 perl 的函数 xls2csv.我认为问题在于 Spreadsheet::XLSX 不支持它.

It is possible for xls workbooks using the perl-based function xls2csv from package gdata. I gather that the problem is Spreadsheet::XLSX doesn't support it.

有多种用于导入非加密 xlsx 工作簿的函数和包,但似乎没有一个能解决这个问题.

There are a variety of functions and packages for importing non-encrypted xlsx workbooks, but none seems to address this issue.

目前似乎唯一的选择是通过 Excel 或弄清楚如何编写可以做到这一点的 perl 代码.

At present it seems the only alternatives are to go through Excel or figure out how to write perl code that can do it.

推荐答案

它看起来是你所需要的,只是它不是 xlsx 包:

It looks to be what you need except it isn't with the xlsx package:

https://stat.ethz.ch/pipermail/r-help/2011-March/273678.html

library(RDCOMClient)
eApp <-  COMCreate("Excel.Application")
wk <-  eApp$Workbooks()$Open(Filename="your_file",Password="your_password")
tf <-  tempfile()
wk$Sheets(1)$SaveAs(tf, 3)

这篇关于将受密码保护的 xlsx 工作簿导入 R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆