in reply to Re: Re: Re: search/replace very large file w/o linebreaks
in thread search/replace very large file w/o linebreaks

But the sysread example sucks whenever a tag is inbetween your BLOCKLENGTH.

Update:I was wrong and promise to read the snippsets more carefully. Want some XP? Ok!

--
Boris

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: search/replace very large file w/o linebreaks
by nothingmuch (Priest) on Jan 09, 2004 at 11:51 UTC
    ysth's example and subsequently mine both use substr to work around it.

    -nuffin
    zz zZ Z Z #!perl
Re: Re: Re: Re: Re: search/replace very large file w/o linebreaks
by ysth (Canon) on Jan 11, 2004 at 03:13 UTC
    That's worked around by scanning each piece of the file twice (except for the very beginning and end), once with more data before it and once with more data after it.

    If this is a run-once-only problem, trying using a tag as the input record separator is the way to go, and only if that fails with out-of-memory go to another approach.

    One other way would be to pick a common character or string from the file that won't appear in any tag (or appears at the end of any tags it is in). For instance, ' ', '>', or 'the' might work, given appropriate data.

      I just upvoted this node, and saw it reach zero.

      For something obscene, rude, or wrong it may be reasonable to downvote. But if a node is as coherent, as the one this is a reply to, please explain your motives. It's really frustrating!

      -nuffin
      zz zZ Z Z #!perl
        I don't get frustrated anymore. I just assume someone hit the wrong button by accident or is voting against me rather than the node.