Are you looking for an exact paragraph match (eg exact spaces, punctuation, and newlines)?
Yes. Basically I'm writing configuration paragraphs into configuration files.

The problem with an exact match is that two configuration paragraphs may be semantically equivalent, but syntactically different, e.g. in a different order, or with different whitespace. It seems, to me, that the only foolproof way to avoid duplicates would be an actual parser for the config files. Unless you can ensure that semantically equal paragraphs will be syntactically identical, you might be creating duplicates. And with a lot of files, as you say you have, this would make cleaning up any mistakes just as hard.

Just something to think about...


In reply to Re: Re: Re: Efficiency: Finding if a file contains a paragraph by revdiablo
in thread Efficiency: Finding if a file contains a paragraph by C_T

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.