Hi all.

Thank you for your assistance. As requested by one of the replies, here is some of the code

s/ <datafield tag="/./i; #begin tag num with "." s/" ind1="/. /i; #end tag num with ". " s/" ind2="//i; #remove text between indic s/">\n//i; #to imprecise? No, its OK. s/ <subfield code="/|/i; #remove text between fields s/">//i; #to imprecise? No, its OK. s/<\/subfield>\n//i; #remove text between fields s/<\/record>\n//i; #remove record end marker s/<\/datafield>//i; #remove end of field marker s/http:\/\/wc.slims.gov.za/WCPLIS/i; #change SITA url to org s/<\/collection>\n//i; #remove end of document if (/\d-\d/) {s/-//g}; #Remove hyphens in ISBN's

This part takes the xml code and puts it into the flat format as required. Below is a sample of the xml code

<datafield ind1="1" ind2="4" tag="245"> <subfield code="a">The solar system</subfield> <subfield code="c">Chris Oxlade [Author]</subfield> </datafield>

Below is the output of one line in the flat file.

.245. 14|aThe solar system|cChris Oxlade [Author]

This perl code is user for all lines with various MARC tags (.024.). It might be possible that I am putting the part to focus on the ISBN correction in the wrong place in the code. I used the line below:

if (/^.024. 3#|a/) {s/.{10}(.............)........../.020. 3#|a$1 +/};

I will try some of the suggestions and see if I can get it sorted. Thank you once again for assisting.


In reply to Re: Remove line and modify another by IceJ
in thread Remove line and modify another 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.