Advertisement

12.18.2004 at 11:57PM PST, ID: 21247533
[x]
Attachment Details

String Replacemnt in an XML file

Asked by micro_learner in Perl Programming Language, Extensible HTML (XHTML)

Tags: change, string, xml

Hello ..I am a bioinformatist ..I have a question on Perl String Matching and Replacemnet ..( I tried doing this but I am unable to get teh desired result...I appreciate your time spent ...thanks)

I have an XML file in which the element
<Biosequence_ref > occours multiple times...
for example ...
<BioSequence_ref identifier="Affymetrix.com:Probe:HG-U133_Plus_2.200607_s_at.698.597"/>
The only variable in the diffrent elements is that the last part after HG-UQ33_Plus_2 ..i.e
(200607_s_at.698.597) changes ...
i.e another Element can be
<BioSequence_ref identifier="Affymetrix.com:Probe:HG-U133_Plus_30007_s_at.729.598"/>


I need to make a string replacement ....bascially

1.Whenever I see a Biosequence_ref element with an Identifier that has the word "Probe" in it
  (There may be other Bioisequence_ref identifiers without the word Probe ..I should not change these)
 
2.I need to change the element into

<BioSequence identifier="Affymetrix.com:Probe:HG-U133_Plus_2.200607_s_at.698.597  sequence="DUMMY"/">
 
(The only addition are
     1. BioSequence_ref changes to Biosequence
     2,New Element sequence="DUMMY" is added which is always constant.    

Thanks for your timeStart Free Trial
[+][-]12.19.2004 at 12:19AM PST, ID: 12860582

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.19.2004 at 12:22AM PST, ID: 12860588

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.19.2004 at 12:39AM PST, ID: 12860653

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.19.2004 at 12:40AM PST, ID: 12860657

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]12.19.2004 at 02:23AM PST, ID: 12861082

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]12.19.2004 at 07:57AM PST, ID: 12862085

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]12.19.2004 at 07:58AM PST, ID: 12862088

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.19.2004 at 01:25PM PST, ID: 12862985

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Perl Programming Language, Extensible HTML (XHTML)
Tags: change, string, xml
Sign Up Now!
Solution Provided By: holli
Participating Experts: 5
Solution Grade: A
 
 
[+][-]12.20.2004 at 12:43AM PST, ID: 12864916

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2004 at 01:27AM PST, ID: 12865057

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.30.2004 at 09:22AM PST, ID: 12927292

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.18.2005 at 06:13PM PST, ID: 13079065

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32