in reply to Re^2: How to reverse a huge file in Perl?
in thread How to reverse a huge file in Perl?

If the file he used doesn't contain any newlines, all it does is a straight copy.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^3: How to reverse a huge file in Perl?

Replies are listed 'Best First'.
Re^4: How to reverse a huge file in Perl?
by samtregar (Abbot) on Mar 26, 2008 at 20:00 UTC
    Didn't he already show you a wc -l? Did you test it yourself and get different results?

    -sam

      Didn't he already show you a wc -l? Did you test it yourself and get different results?

      No. He only added the wc after I asked how many lines were in the file. And I asked because the only way I could reproduce anything like his results was if I ran tac on a large file that contained few or no newlines. It is faster, but not by the margins his test showed.

      Then again, I'm using a win32 native port of tac and I do not know how close it is to the *nix version, or if it uses the same algorithm.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re^4: How to reverse a huge file in Perl?
by Anonymous Monk on Mar 26, 2008 at 18:48 UTC
    If the file he used doesn't contain any newlines

    Obviously, the file does contain 323833 newlines.