<?xml version="1.0" encoding="UTF-8"?>
<marc:record xmlns:marc="http://www.loc.gov/MARC21/slim">
<marc:leader> 00000cz a2200000n 4500 </marc:leader>
<marc:controlfield tag="001"> fst01332189 </marc:controlfield>
<marc:controlfield tag="003"> OCoLC </marc:controlfield>
<marc:controlfield tag="005"> 20180103163101.0 </marc:controlfield>
………………….
<marc:datafield tag="043" ind1=" " ind2=" "> <marc:subfield code="a"> a-ii--- </marc:subfield> </marc:datafield>
<marc:datafield tag="151" ind1=" " ind2=" "> <marc:subfield code="a"> India </marc:subfield> <marc:subfield code="z"> Coimbatore (District) </marc:subfield> </marc:datafield>
<marc:datafield tag="451" ind1=" " ind2=" "> <marc:subfield code="a"> India </marc:subfield> <marc:subfield code="z"> Coimbator District </marc:subfield> </marc:datafield>
<marc:datafield tag="451" ind1=" " ind2=" "> <marc:subfield code="a"> Kōyamputtūr Māvaṭṭam </marc:subfield> </marc:datafield>
…………………….
<marc:datafield tag="751" ind1=" " ind2="0"> <marc:subfield code="a"> Coimbatore (India : District) </marc:subfield> <marc:subfield code="0"> (viaf)147778104 </marc:subfield> <marc:subfield code="0"> https://viaf.org/viaf/147778104 </marc:subfield> </marc:datafield>
</marc:record>
value.parseXml().select("marc|datafield[tag=451]")[0].select("marc|subfield[code=a]")[0].xmlText() + "--" +value.parseXml().select("marc|datafield[tag=451]")[0].select("marc|subfield[code=z]")[0].xmlText()
But your solution is an elegant one as always.
I have tried your solution to generate forEach (as in many records tag 451 is repeated)and got result nicely -
forEach(value.parseXml().select("marc|datafield[tag=451] marc|subfield[code~=(a|z)]"),e,e.xmlText()).join("\n") >> India
Tarmapuri Māvaṭṭam
India Tarumapuri Māvaṭṭam
Is it possible to tinker the above expression to generate in one go something like this?
$aIndia$zTarmapuri Māvaṭṭam
$aIndia$zTarumapuri Māvaṭṭam
Best regards
--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/0ab7ad37-4a42-4b43-83d6-fc622ebc2cd1n%40googlegroups.com.
I have tried your solution to generate forEach (as in many records tag 451 is repeated)and got result nicely -forEach(value.parseXml().select("marc|datafield[tag=451] marc|subfield[code~=(a|z)]"),e,e.xmlText()).join("\n") >> India Tarmapuri Māvaṭṭam
India Tarumapuri Māvaṭṭam
Is it possible to tinker the above expression to generate in one go something like this?
$aIndia$zTarmapuri Māvaṭṭam
$aIndia$zTarumapuri Māvaṭṭam
--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/ad81d5f1-b7f4-41da-ac9d-a6e9e19ce5a9n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/CAGM_5uYqY_7Em8C5aMWWYT2T57aXexrgh4EtBhh5XRqAbQLVBw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/CAChbWaMsATF4ap1dxk6LmyHKUy9txti53%2BMoJNK9wmA8b7gQyw%40mail.gmail.com.