I'd be grateful for help in solving this little problem. I'm trying to convert a large body of ASCII text to delimited text (50 mgb).

Each item of text is currently formatted as follows (there are about 20k of these that need to be converted):

^46004 % Tamerlane.| Tamerlane - Sheridan; Bajazet - Barry; Moneses - A Gentleman; Arpasia - Mrs. Furnival; Selima - Mrs. Elmy; +

I would like it to look like this (but w/o double spacing) for importation into a database:

"46004","Tamerlane","Tamerlane","Sheridan"
"46004","Tamerlane","Bajazet","Barry"
"46004","Tamerlane","Moneses","A Gentleman"
"46004","Tamerlane","Arpasia","Mrs. Furnival"
"46004","Tamerlane","Selima","Mrs. Elmy"
Here's another example of the sort of text:

^46005 % Hamlet.| Hamlet - Sheridan; Polonius - J. Morris; Laertes- Lacy; Ophelia- Mrs. Storer; Queen - Mrs. Furnival; +

Changed to:

"46005","Hamlet","Hamlet","Sheridan"
"46005","Hamlet","Polonius ","J. Morris"
"46005","Hamlet","Laertes","Lacy"
"46005","Hamlet","Ophelia","Mrs. Storer"
"46005","Hamlet","Queen","Mrs. Furnival"
Any help gratefully acknowledged.


In reply to Help formatting text to delimited text in file by jcg3525

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.