Thank you guys for your great help! I tested your advices on the "big file". More important, I seem to understand some of your code :-)
The patterns
/^(\d\-\d\w{2}(?:\.\w+)?|[A-Z]\d{2}(?:\.\d+)?)/
must have the second part
(?:\.\w+)? resp. (?:\.\d+)?)
since there are some items ID as just M32 or 6-317
It seems that I cannot use grep length ... and splice ... with the "?"-part since the item text will be cut in pieces. Perhaps I do not notice something (I am a novice in perl) since I learned the grep length construction only now after reading your code.
There are some "trash lines" with parenthesis so that the title line can be distinguished as it has parenthesis part at the end only.
By now the code of thewebsi seems to work the best with the file. There are still some trash lines in the output but comparatively few and the can be filtered out by data content.
Thank you all again - for the code and for the class hour!
VE

In reply to Re^2: Insert newline by Anonymous Monk
in thread Insert newline 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.