Good point. These limitations that Errto mentions can indeed be a major pain in the *fill-the-blank*. Therefore, here is a quick 'step-by-step' guide that may save you a lot of wasted time.

STEP: Open the 'form letter' MSFT WORD document with the blanks (aka open ClientIntakeFormFoo.doc)

STEP: Use MSFT WORD to fill in the document with obviously bogus data (e.g. FAKE_FIRSTNAME, FAKE_LASTNAME, FAKE_FOO, FAKE_BAR)

STEP: Save the filled in document as ClientIntakeFormFoo.htm in MSFT HTML

STEP: Search thru the file you just saved for every instance of m/FAKE_[^\s]+/

STEP: replace the sections you found in the previous step with 'quotelike escapes' (e.g., dear, ^.$NAME.q^ we are gonna sue you if you dont pay ^.$AMOUNT.q^ .)

STEP: enclose the entire html file with an 'outer quotelike' $sOutput = q^ DOCUMENT GOES HERE ^;

STEP: save the entire htm file as a perl module that you can use with your perl scripts and you are basically done.

Beware of all the limitations that Errto and others have mentioned, but this is a solution that should work well, because it saves you from having to learn the ugly and complicated MSFT markup. All you have to do is fill in your easily found 'blanks' ignore the rest. Be sure to enclose your document with a single 'quotelike' (not doublequotes), so that perl does not accidentally interpolate anything that occurs inside your file, other than the 'quotelike escapes' that you supplied.

In reply to Re: Re: Re: Re: parse MS Word Template fields for legal documents by dimar
in thread parse MS Word Template fields for legal documents by Anonymous Monk

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.