Enable running multiple Find/Replace in Files in background

Are you missing a feature? Request its implementation here.
tatra603
Posts: 76
Joined: Fri Sep 17, 2004 10:53 am
Location: Prague, the Czech Republic, Europe

Enable running multiple Find/Replace in Files in background

Post by tatra603 »

Hello,

I would like to ask to to enable parallel running multiple Find/Replace in Files in background. When I have long running Find/Replace (simple one, in Files) even for some hours, I would be nice to enable running them in background. It should be up the user, if he define XOR file paths or other conditions to prevent weird results.

Thank You in advance, Stepan
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Enable running multiple Find/Replace in Files in background

Post by Radu »

Hi Stepan,
We will consider this but we just have not had much demand for it.
There is a registered internal issue and I added your contact details to it:
EXM-51409 Minimize progress dialog used for Find/Replace in Files
Can you tell me why it takes that much to find content on your side? Are you searching over a shared network drive or over remote sources from the Data Source Explorer view?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Enable running multiple Find/Replace in Files in background

Post by chrispitude »

Hi Stepan,

In the Oxygen project I have open, Find/Replace in Files took 145 seconds to search 41,861 files.

How many files do you have, and how long does a search take?
tatra603
Posts: 76
Joined: Fri Sep 17, 2004 10:53 am
Location: Prague, the Czech Republic, Europe

Re: Enable running multiple Find/Replace in Files in background

Post by tatra603 »

Hi, I am sorry, I missed notification about Your replies...

My use case is:

rem in oXygen steps to reproduce (2 times for each attribute aaa and bbb):
rem Text to find: aaa="[a-z0-9-]+" or Text to find: bbb="[^"]+"
rem Regular expression: yes
rem Restrict to XPath: /*/*/attribute::aaa or Restrict to XPath: /*/*/attribute::bbb
rem Replace with: aaa="Me: normalised" or Replace with: bbb="Me: normalised"
rem Specified path: C:\Temp\backups\production
rem Include files: *.xmlAType, *.xmlBType, *.xmlCType, *.xmlDType
rem Recurse subdirectories: yes
rem Replace all...

So running in parallel replacing for attributes aaa and bbb would be an advantage for me.

The aim of this replace is to "remove" or "normalize" two certain attributes (where is stored info about deployment) among different servers and environments. I need to ignore these deployment info and then I calculate SHA256 for each such normalized file and then find real differences among files with same relative paths. Thus I can not easily use something like oXygen diffDirs etc.

Size of disk: 3 times this 8.13 GB (8,734,445,568 bytes)
Contains: 3 times this 451,230 Files, 291,924 Folders

So running on background would be nice for me. But I know, it is not usual use case.

Also... Long time ago there was RFE to be able to have Find and Replace able to save in something like named Bookmark to be able to easily exactly reproduce Find and Replace action and then customize saved action before funning it (e. g. change path to actual one). Is there any progress?

Regards, Stepan
tatra603
Posts: 76
Joined: Fri Sep 17, 2004 10:53 am
Location: Prague, the Czech Republic, Europe

Re: Enable running multiple Find/Replace in Files in background

Post by tatra603 »

Maybe I should rather use some other approach like Refactoring using XQuery to completely remove both these two attributes? To be able to run it in one pass and quicker?
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Enable running multiple Find/Replace in Files in background

Post by chrispitude »

Hi Stepan,

I think a refactoring operation would work well here. Can you describe in words what you want to do? For example,
  • It looks like you want to replace values of @aaa and @bbb?
  • Do you want to match @aaa and @bbb only when they match the two different regular expressions to provide, and leave the other values of those attributes as-is?
If you help me understand exactly what you want to do, I can make a refactoring operation for you.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Enable running multiple Find/Replace in Files in background

Post by Radu »

Hi,
Find/Replace in Files would in general be much faster than XML Refactor. But as in this case "Restrict to XPath" is being used for Find/Replace in Files, the time it would take XML refactor might be comparable to do the same thing, especially as you both said that with XML refactor you can modify both attributes in a single pass.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply