codewalker has asked for the wisdom of the Perl Monks concerning the following question:
Below I mentioned the Code. I need how to replace it using id numbers
Need to replace <xref ref-type="bibr" rid="b0001">Ewald <italic>et al.</italic>, 1993</xref> as <xref ref-type="bibr" rid="Ewald1">Ewald <italic>et al.</italic>, 1993</xref>
To Take the text from the ref-list id and replace in call outs
Example:
<xref ref-type="bibr" rid="b0001">Ewald <italic>et al.</italic>, 1993</xref>
<bib id="CIT-Ewald-b0001"> take the text found in id inbetween the text CIT- and -b0001 i.e. "Ewald" and find the id found in body text i.e. rid="b0001" and replace as rid="Ewald1"
<bib id="CIT-Kasten-b0002"> take the text found in id inbetween the text CIT- and -b0002 i.e. "Kasten" and find the id found in body text i.e. rid="b0002" and replace as rid="Kasten2"
Now u onderstand what I am asking
<body><p>Approximately 125 231 joint replacements and 442 total + elbow replacements were performed in England and Wales in 2013 accor +ding to data collected by the <xref ref-type="bibr" rid="b0004">Natio +nal Joint Registry (2014)</xref>. Elbow replacements have a deep infe +ction rate ranging from 1 to 12 % (<xref ref-type="bibr" rid=" +b0001">Ewald <italic>et al.</italic>, 1993</xref>; <xref ref-type="bi +br" rid="b0002">Kasten & Skinner, 1993</xref>), with an estima +ted mean of 5 % (<xref ref-type="bibr" rid="b0003">Little <ita +lic>et al.</italic>, 2005</xref>).</p><p><italic>Staphylococcus aureu +s</italic> and <italic>Staphylococcus epidermidis</italic> together a +ccount for approximately 50 % of the agents isolated from infe +cted joint prostheses, making them the most common causative bacteria + (<xref ref-type="bibr" rid="b0005">Tattevin <italic>et al.</italic>, + 1999</xref>). Bacteria responsible for elbow prostheses infections i +nclude <italic>Staphylococcus aureus</italic>, <italic>Staphylococcus + epidermidis</italic>, <italic>Klebsiella</italic> spp. and <italic>E +nterobacter cloacae</italic> (<xref ref-type="bibr" rid="b0006">Yamag +uchi <italic>et al.</italic>, 1998</xref>).</p></body> <back><ref-list> <bib id="CIT-Ewald-b0001"><citation citation-type="journal"><article-t +itle>Capitellocondylar total elbow replacement in rheumatoid arthriti +s. Long-term results</article-title> <source>J Bone and Joint Surg</s +ource> <volume>75</volume> <fpage>498</fpage>–<lpage>507</lpag +e>.</citation></ref> <bib id="CIT-Kasten-b0002"><citation citation-type="journal"><article- +title>Total elbow arthroplasty. An 18-year experience</article-title> +<source>Clin Orthop</source><volume>290</volume><fpage>177</fpage>&#x +2013;<lpage>188</lpage>.</citation> <bib id="CIT-Little-b0003"><article-title>Total elbow arthroplasty: a +systematic review of the literature in the English language until the + end of 2003</article-title><source>J Bone Joint Surg Br</source><vol +ume>87</volume><fpage>437</fpage>–<lpage>444</lpage>.</citatio +n></ref> <bib id="CIT-National-b0004"><citation citation-type="book"><inpress>< +ext-link ext-link-type="url" xlink:href="http://www.njrcentre.org.uk/ +njrcentre/healthcareproviders/accessingthedata/statsonline/njrstatson +line/tabid/179/default.aspx">http://www.njrcentre.org.uk/njrcentre/He +althcareproviders/Accessingthedata/StatsOnline/NJRStatsOnline/tabid/1 +79/Default.aspx</ext-link>. Accessed 25 January 2014</inpress>.</cita +tion></ref> <bib id="CIT-Tattevin-b0005"><article-title>Prosthetic joint infection +: when can prosthesis salvage be considered?</article-title><source>C +lin Infect Dis</source><volume>29</volume><fpage>292</fpage>–< +lpage>295</lpage>.</citation> <bib id="CIT-Yamaguchi-b0006"><article-title>Infection after total elb +ow arthroplasty</article-title><source>J Bone Joint Surg Am</source>< +volume>80</volume><fpage>481</fpage>–<lpage>491</lpage>.</cita +tion> </ref-list> </back>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search and replace the Text using id numbers in perl using hash
by LanX (Saint) on Feb 09, 2015 at 12:41 UTC | |
|
Re: Search and replace the Text using id numbers in perl using hash
by kroach (Pilgrim) on Feb 09, 2015 at 12:48 UTC | |
by Happy-the-monk (Canon) on Feb 09, 2015 at 12:56 UTC | |
|
Re: Search and replace the Text using id numbers in perl using hash
by kroach (Pilgrim) on Feb 09, 2015 at 20:58 UTC |