I really like your idea. I am also not convinced at all that any programming is required at all. This appears to be a "one off" modification of a file - not some sort of thing that will be regularly done.

If the user is on Windows, I would suggest Notepad+ as a freeware editor. I use TextPad which is a "pay for" program, but I think similar to NotePad+. TextPad 4 from 25 years ago implements essentially the s/regex/regex/ functionality in the edit window. I have been offered an upgrade to TextPad 8, but I haven't bothered because what I have works fine.

I suspect that some "human guided" modification of the file using a good decades old editor will get the job done faster than trying to write some general purpose program.

Update: My attention span for this is perhaps 5-10 substitutions. I do those on a "review then approve" basis. After I have seen the regex work correctly for the first 5-10 or so cases in a row, then I turn the editor free to do the rest of the file without my explicit approval for each modification. Sometimes a very weird case is missed. If so then I fix that one again manually. Of course since this is being done in an editor, you can back out of any and all changes before saving the modified file.

The OP does not present a clear spec on what is allowed and what is not allowed - there is no "spec".


In reply to Re^2: Help to create a program by Marshall
in thread Help to create a program by fair

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.