Author Topic: Narrowing the multi-file searc/replace scope  (Read 4097 times)

mzel

  • Community Member
  • Posts: 29
  • Hero Points: 0
Narrowing the multi-file searc/replace scope
« on: April 20, 2017, 06:04:45 PM »
Hi all,
I have a project of ~400 files within a workspace of  ~2000 files. All are .h and .cpp files. Can I limit the scope of  search and replace to a subset of ~15 files.
Is there such a thing as sub-project? Can the same file be included in more than one project within a workspace?
TIA, Mark

hs2

  • Senior Community Member
  • Posts: 2762
  • Hero Points: 292
Re: Narrowing the multi-file searc/replace scope
« Reply #1 on: April 20, 2017, 06:19:39 PM »
Quote
Can the same file be included in more than one project within a workspace
Yes. But there is no such thing as a sub-project.
You could e.g. open (only) these 15 files and search 'All Buffers'.
HS2

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: Narrowing the multi-file searc/replace scope
« Reply #2 on: April 20, 2017, 07:24:28 PM »
If a file can be included in multiple projects, then you could create a special project with just those 15 files. Set it as the active project and limit your search to the project.

mzel

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: Narrowing the multi-file searc/replace scope
« Reply #3 on: April 20, 2017, 08:32:25 PM »
Yes, I was missing the "if" part. Still does anybody know of a different way?

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: Narrowing the multi-file searc/replace scope
« Reply #4 on: April 20, 2017, 08:48:03 PM »
As far as I know, your search options are limited by the selections in the Look in: pull-down in the Find dialog. So "All Buffers" or a specific project seem like the best options.

mzel

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: Narrowing the multi-file searc/replace scope
« Reply #5 on: April 20, 2017, 08:55:48 PM »
Ok, thanks everybody who replied

Dennis

  • Senior Community Member
  • Posts: 3998
  • Hero Points: 521
Re: Narrowing the multi-file searc/replace scope
« Reply #6 on: April 21, 2017, 10:32:32 PM »
You could just paste all 15 file names into the "Look in:" box of the "Find in Files" tool window.  Make sure you quote them if the paths contain spaces.

mzel

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: Narrowing the multi-file searc/replace scope
« Reply #7 on: April 21, 2017, 10:36:43 PM »
Wow, that is a good one!
Thanks for the tip!