r - 用 7z 读取压缩文件
问题描述
我想用fread
R 读入一个文件。我已经7z
安装了。
我试过了
fread(shell(cmd = '7z l test.txt.gz'), shell = 'cmd.exe'))
但是我得到了错误
Error in fread(shell(cmd = paste0("7z x ", "\"", dest, "\""), shell = "cmd.exe")) :
'input' must be a single character string containing a file name, a command, full path to a file, a URL starting 'http[s]://', 'ftp[s]://' or 'file://', or the input data itself
我正在寻找类似的东西:
fread(shell(cmd = 'unzip -cq test.zip', shell = 'cmd.exe'))
解决方案
一种解决方法是复制7z.exe
到项目文件夹。并尝试:
DT = fread(cmd = '7z e -so "test.zip"')
有人建议将 7-zip 添加到 Windows PATH 环境变量中。但这对我不起作用。
推荐阅读
- printing - 如何在 Rust 中打印 N 次字符?
- python - Python中LinkedList实现的remove函数问题
- python - 带有图像的 Twitter 状态,但 tweepy.API.get_status 不返回任何媒体
- python - Levenshtein 两个文件的距离太长
- python - 更新 Heroku 上的 Python setuptools
- office365 - 如何将我的订阅 office 365 business basic 连接到 Editor ADSI?
- node.js - 升级到 AnonymousTraversalSource (Gremlin 3.3.5+ Node.js)
- reactjs - 上传到 firebase:TypeError:uploadTask.on 不是函数
- javascript - 通过 UIKit 模式向数组添加元素在 vuejs 中不起作用
- scala - 执行捕获变量的嵌套函数分配