[英]Read excel file from AWS S3 Bucket
Currently I have a method to read an excel file that is on my local machine using filename path like this: 目前,我有一种使用文件名路径读取本地计算机上的excel文件的方法,如下所示:
// Create COM Objects. Create a COM object for everything that is referenced
Console.WriteLine("Begin reading file...");
Excel.Application xlApp = new Excel.Application();
Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"C:\Users\user1\Desktop\file1.xlsx");
Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1];
Excel.Range xlRange = xlWorksheet.UsedRange;
// Some code here
Now I have to read the file from an AWS S3 bucket, and I'm pretty new to the whole AWS environment. 现在,我必须从一个AWS S3存储桶中读取文件,并且对于整个AWS环境而言,我还是一个新手。 From all the sources I read I think the file you get from a S3 bucket only can be returned as "stream" type.
从我阅读的所有资料中,我认为您只能将从S3存储桶中获取的文件作为“流”类型返回。
How do I make it work with my current method? 如何使其与当前方法兼容?
Is there other better way to do this, my goal is just read an excel file from a S3 bucket and do something with the data inside. 还有其他更好的方法可以做到这一点,我的目标是从S3存储桶中读取一个excel文件,并对内部数据进行处理。
There are a couple of things you can do. 您可以做几件事。 Here's a couple
这是一对
I'm sure you're aware by now, one thing you'll need to watch out for is the file permission while your process is working with the file. 我确定您现在已经知道,您需要注意的一件事是在您的进程使用文件时的文件许可权。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.