ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Getting Approximate Row Count of a Huge File

Getting Approximate Row Count of a Huge File

Linux操作系统 作者:chncaesar 时间:2013-11-12 21:15:29 0 删除 编辑

This blog is originated from stackoverflow.com

Step 1: head -n filename > newfile // get the first n lines into newfile,e.g. n =5

Step 2: Get the huge file size, A

Step 3: Get the newfile size,B

Step 4: (A/B)*n is approximately equal to the exact line count.

Set n to be different values,done a few times more, then get the average.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/638844/viewspace-776435/,如需转载,请注明出处,否则将追究法律责任。

下一篇: GoldenGate Tips
请登录后发表评论 登录
全部评论

注册时间:2013-07-30

  • 博文量
    102
  • 访问量
    899691