.NET 核心/Python 从 Azure 存储 Blob 读取前 X 行 [英] .NET core/Python Read first X lines from Azure Storage Blob

查看:29
本文介绍了.NET 核心/Python 从 Azure 存储 Blob 读取前 X 行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大 blob,我需要从中提取前几行.我可以在不打开整个文件的情况下执行此操作吗?

文件采用已知格式(通常为 Excel,有时为 .csv 或 .tsv).

只要知道它是否可能会非常有帮助.在搜索 MS 和其他论坛时,我根据日期获得了不同的答案.谢谢!

解决方案

我有一个大 blob,我需要从中提取前几行.我可以在不打开整个文件的情况下执行此操作吗?

答案是肯定的和否定的.是的,您可以阅读部分内容,但无法阅读前几行.

本质上,Blob 存储服务允许您执行范围读取,您可以在其中指定要读取的数据范围(起始字节和要读取的字节数).在请求中指定范围后,Azure 存储将只返回这些字节.

如果您使用的是 .Net SDK,请查看 解决方案

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.

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.

If you're using .Net SDK, please look at DownloadStreaming method.

这篇关于.NET 核心/Python 从 Azure 存储 Blob 读取前 X 行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆