Highlighted

How to Find/Replace (also using Wildcards)

Community Beginner ,
Apr 01, 2020

Copy link to clipboard

Copied

This is somewhat of a two-parter. I have an XML file that has many lines that look like this:

 

<something id="54875" source="something.me">
<code>./random/text/here.html</code>
<morecode>./more/random/text/here.html</morecode>
</something>

 

This snippet above repeats sevearl hundred times. I need to find all the instances where the <code> and <more> lines apear, then add a third line under it so it looks like this:

 

<something id="54875" source="something.me">
<code>./random/text/here.html</code>
<morecode>./more/random/text/here.html</morecode>

<addedcode>./added/random/text/here.html</addedcode>
</something>

 

Furthermore, each snippet has unique text between the brackets. So I'll need to use a wildcard so it ignores anything written inside the <code> and <more>, so I can go line by line copy/pasting the replacment text.

 

How can I easily do this in Dreamweaver (or another app if needed)?

TOPICS
Code, How to

Views

416

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to Find/Replace (also using Wildcards)

Community Beginner ,
Apr 01, 2020

Copy link to clipboard

Copied

This is somewhat of a two-parter. I have an XML file that has many lines that look like this:

 

<something id="54875" source="something.me">
<code>./random/text/here.html</code>
<morecode>./more/random/text/here.html</morecode>
</something>

 

This snippet above repeats sevearl hundred times. I need to find all the instances where the <code> and <more> lines apear, then add a third line under it so it looks like this:

 

<something id="54875" source="something.me">
<code>./random/text/here.html</code>
<morecode>./more/random/text/here.html</morecode>

<addedcode>./added/random/text/here.html</addedcode>
</something>

 

Furthermore, each snippet has unique text between the brackets. So I'll need to use a wildcard so it ignores anything written inside the <code> and <more>, so I can go line by line copy/pasting the replacment text.

 

How can I easily do this in Dreamweaver (or another app if needed)?

TOPICS
Code, How to

Views

417

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 01, 2020 0
Adobe Community Professional ,
Apr 01, 2020

Copy link to clipboard

Copied

  1. Ctrl + Shift + F to Find.
  2. Search for <code> in entire local site.
  3. Hit Find All button.
  4. In the Search results panel (F7), double-click an item to open that document.
  5. Edit as required.
  6. Repeat with other Search results.

 

 

Nancy O'Shea, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 01, 2020 0
Community Beginner ,
Apr 01, 2020

Copy link to clipboard

Copied

Thanks for the quick reply. One issue is that the "./random/text/here.html" between the code is always different. So I need to insert a wild card here so it ignores those lines and just pulls up all the instances for the code line. Otherwise it's only going to return a search for that one line with that specific text. Know what I mean?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 01, 2020 0
Adobe Community Professional ,
Apr 01, 2020

Copy link to clipboard

Copied

No, I don't know what you mean.  Don't over complicate this. Just search for <code> without any text.

 

Nancy O'Shea, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 01, 2020 0