比较两个大的 csv 文件

发布于 2025-01-09 19:34:58 字数 270 浏览 3 评论 0原文

我正在尝试比较两个大型 CSV 文件(260Gb 和 16GB),我想到了两种方法,

  1. 取出特定列(使用列号),附加到新的 csv。我认为它可能会减少大小,然后我将创建块

  2. 每次运行代码以基于一个列值提取一组列时创建块,例如: 如果 col['name'] == 'disney' ,则取出与该值匹配的行并附加到新的 csv。 最后将新的 csv 与 16gb csv 文件进行比较。

关于这里最好的方法是什么有什么建议吗?

I am trying to compare two large CSV files( 260Gb and 16gb) , I have two approaches in mind,

  1. taking out particular columns(using column numbers), append to new csv. I think it might reduce size and then I will be to create chunks

  2. each time run a code to extract a set of columns based on a one column value, eg:
    if col['name'] == 'disney' , then take out rows matching that value and append to new csv.
    Finally comparing new csv with 16gb csv file.

Any suggestions on what would be the best approach here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文