in reply to Remove line and modify another
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remove line and modify another
by poj (Abbot) on Sep 06, 2018 at 07:17 UTC |