问题描述
我有一个大的 blob,我需要从中提取前几行.我可以在不打开整个文件的情况下执行此操作吗?
I have a large blob which I need to extract the first few rows from. Can I do this without opening the entire file?
文件采用已知格式(通常为 Excel,有时为 .csv 或 .tsv).
The file is in a known format (typically Excel, sometimes .csv or .tsv).
仅仅知道它是否可能会非常有帮助.在搜索 MS 和其他论坛时,我根据日期获得了不同的答案.谢谢!
Just knowing if it is possible would be extremely helpful. I've obtained mixed answers, based on date, while searching MS and other forums. Thank you!
推荐答案
我有一个大的 blob,我需要从中提取前几行.我可以在不打开整个文件的情况下执行此操作吗?
I have a large blob which I need to extract the first few rows from. Can I do this without opening the entire file?
答案是肯定的和否定的.是的,你可以阅读部分内容,但是你不能阅读前几行.
The answer is both yes and no. Yes, you can read partial contents however you can't read the first few lines.
本质上,Blob 存储服务允许您执行范围读取,您可以在其中指定要读取的数据范围(起始字节和要读取的字节数).在请求中指定范围后,Azure 存储将仅返回这些字节.
Essentially Blob Storage Service allows you to perform a range read where you can specify the range of data (starting bytes and number of bytes to read) that you want to read. Once the range is specified in the request, Azure Storage will only return those bytes.
如果您使用的是 .Net SDK,请查看 DownloadStreaming
方法.
If you're using .Net SDK, please look at DownloadStreaming
method.
这篇关于.NET core/Python 从 Azure Storage Blob 读取前 X 行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!