SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jan 2012
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Search and Replace in Select Files Only

    I couldn't figure out what forum to post this question in, so I'll start here.

    Imagine the following folders:

    Info/Family/Mammals/
    Info/Family/Birds/
    Info/Family/Plants/

    Imagine that each folder (Mammals, Birds, etc.) contains files named Behavior.php, Reproduction.php, etc. Now suppose I want to replace "this" with "that" - but only in files named Behavior.php. I could target the folder Info/Family, but that would change "this" on files named Reproduction.php as well.

    Is there a way to do search and replace operations that only target files with a specific name (or other criteria)?

    I'm using Dreamweaver CS3 on a Mac and just discovered Mac's "Smart Window," which lets you DISPLAY select files in a Finder window. But I haven't yet figured out if there's a way to search those files without searching other files in the same folders. I tried Dreamweaver and TextWrangler with no luck.

    Thanks for any tips.

  2. #2
    SitePoint Zealot RyanKing1809's Avatar
    Join Date
    Oct 2011
    Location
    Melbourne, Australia
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's probably a simpler way but what I would do in this case is open up the "Family" folder in finder & in the search bar search for "Behavior.php" - when the search bar appears select "Family" rather than 'This Mac'.

    That should give you all the available Behaviour.php files.

    It may be the case that finder is searching inside your php files and returning unwanted files. In this case click the '+' on the right of the search bar. On the drop-down menu change 'Kind' to 'Name' and enter Behaviour.php.

    Open all those files in dreamweaver.

    And from memory I believe dreamweaver has a search and replace function - and within that function there's an option to search and replace all open files.

  3. #3
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,312
    Mentioned
    178 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by RyanKing1809 View Post
    And from memory I believe dreamweaver has a search and replace function - and within that function there's an option to search and replace all open files.
    I can confirm this.
    When you open the search and replace dialogue in DW, there is a dropdown menu where you can select "Open documents"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •