• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Find and Replace in Files

Contributor ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Hi all.

I have many entries to change using 'find and replace in files'.

My question is:

Can I use a wildcard in my searches?

For example * inside "" .

If wanting to change hundreds of different entries after data-lightbox="*" , where * is the variable and then replace all the finds with say "new entry" data-lightbox="new entry".

 

Views

240

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
community guidelines
Community Expert ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Dreamweaver allows the use of Regular Expressions in the F&R tool.

Hit Ctrl/Cmnd + Shift + F > Advanced > Mystery Martini Glass Icon > Check "Use Regular Expressions" 

regex.jpg



This might help get you started: https://www.peachpit.com/articles/article.aspx?p=1927738&seqNum=19

For some reason, Adobe has deleted the 2 part tutorial it used to have available in the forum. It's a shame. The info was old, but it was still accurate.

 

Votes

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
community guidelines
Contributor ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Thanks Jon that did help a lot. Very good article.

However, perhaps I'm being stupid. I can't get it to look at data-lightbox="Sunrise-1.jpg"

The search stops at data-lightbox="S while I need it to go all the way to the end (") or even the last .jpg

I've tried different combinations, the last one being data-lightbox="[\w] and data-lightbox="[\w]JPG>

Votes

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
community guidelines
Community Expert ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

For RegEx challenged folks like me, Advanced F&R might be all you need.  See screenshot.

 

image.png

 

Hope that helps.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

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
community guidelines
Contributor ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Thanks Nancy.

This is replacing one string with no variables.

For instance data-lightbox=" with data-lightbox="new data"

My search needs to encompass lots of different variables between " and "

For example:

data-lightbox="Sunrise @29.jpg"

data-lightbox="Sunrise-1.jpg"

data-lightbox="StAsunset.jpg"

I have hundreds of different file names in many directories and all need to be changed to one value.

data-lightbox="New Name"

So my search need to be able to find data-lightbox="Any character"

Or am I wrong Nancy in how advanced works?

Votes

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
community guidelines
Community Expert ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Right.  Any value = any value.

foo.jpg

FOO.JPG

foo_fighters.jpg

folder/foo.jpg

folder/folder/foo.jpg

etc...

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

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
community guidelines
Community Beginner ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Hi, 
Please Try this:
Hit Ctrl/Cmnd + Shift + F > Advanced > Mystery Martini Glass Icon > Check "Use Regular Expressions" 

Votes

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
community guidelines
Contributor ,
Jan 29, 2021 Jan 29, 2021

Copy link to clipboard

Copied

LATEST

Thanks for the input folks. 
I managed to achieve my goal using your suggestions but in a round about way. 
Hope Adobe update or make this a bit easier for folks at my level. 

Votes

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
community guidelines