【问题标题】:Read contents of files on s3 bucket without downloading无需下载即可读取 s3 存储桶上的文件内容
【发布时间】:2016-12-12 06:08:21
【问题描述】:

我对 aws 和 s3 很陌生,所以如果这看起来我没有尝试过任何东西,请原谅。我想遍历目录和文件,读取文件并从可公开访问的 s3 存储桶中检索特定行:s3://cgl-rnaseq-recompute-fixed/ 而无需下载。我希望能够对文件内容执行基本任务,例如grep/cat

例如我应该能够从 s3 存储桶上的所有文件和文件夹中获取包含 MYCN 的行。

最有效的方法是什么? R/Python 中是否有可以帮助遍历 s3 存储桶的包?

谢谢!

【问题讨论】:

标签: python r amazon-s3


【解决方案1】:

http://boto.readthedocs.io/en/latest/s3_tut.html

conn = boto.s3.connection.S3Connection(
        aws_access_key_id='xxx',
        aws_secret_access_key='yyy'
)
for key in conn.list(prefix='logs/*.log'):
    print key 

【讨论】:

  • 这究竟是如何回答这个问题的?
猜你喜欢
  • 2020-12-28
  • 2021-07-24
  • 2012-12-20
  • 2019-09-19
  • 2018-05-20
  • 2016-07-12
  • 2017-02-16
  • 2021-01-21
  • 2015-11-02
相关资源
最近更新 更多