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

查看:106
本文介绍了将受密码保护的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天全站免登陆