ReplInFiles - Project scope - HOW???

ReplInFiles - Project scope - HOW???

112
Power UserPower User
112

    Sep 05, 2006#1

    How do I specify that the ReplInFiles command is to search the Project?

    There doesn't seem to be any mechanism to do this?

    Recording the macro merely compounds the uncertainty...

    TIA,
    Paolo
    There is no such thing as an inconsistently correct system...
    Therefore, aim for consistency; in the expectation of reaching correctness!

    6,688586
    Grand MasterGrand Master
    6,688586

      Sep 05, 2006#2

      Calm down. The Replace In Files dialog has the option "Project Files". The macro command ReplInFiles also supports the option ProjFiles although it is not listed in the help and not correct recorded. I will report these issues.

      Now I switched back from v12.10b to v12.10a because the preliminary version 12.10b of UE, a mixture of v12.10a and UEStudio v6.00 has really more new problems than solved problems. Only the help and maybe also the FTP/SFTP feature (not tested because never use) is better in v12.10b.
      Best regards from an UC/UE/UES for Windows user from Austria

      112
      Power UserPower User
      112

        Sep 06, 2006#3

        The ProjFiles option is NOT recorded by the recorder - that's why I posted the note...

        It does look as though 12.10b is seriously broken... Like you, I'm going back to 12.10a... :roll:

        Paolo
        There is no such thing as an inconsistently correct system...
        Therefore, aim for consistency; in the expectation of reaching correctness!

        6,688586
        Grand MasterGrand Master
        6,688586

          Sep 06, 2006#4

          PaoloFCantoni wrote:The ProjFiles option is NOT recorded by the recorder.
          Correct and also reported by me to IDM yesterday. There are also some other problems with recording a Find In Files or Replace In Files. Currently a recorded FindInFiles or ReplaceInFiles command must be always edited after macro recording or the macro will not work as expected. The help about these commands was improved but contains still mistakes and missing parameter explanations. I reported these help mistakes yesterday too.
          Best regards from an UC/UE/UES for Windows user from Austria

          112
          Power UserPower User
          112

            Sep 06, 2006#5

            As always, Thanks for your efforts on our behalf...

            Paolo

              Oct 25, 2006#6

              With the "Fix" for Perl Regular Expressions in Replace in Files for 12.20+1,

              I thought I'd give this another try...

              Can anybody (Mofi) show me the syntax for ReplInFiles for ProjFiles?

              I can make the RE work OK manually throughout the project, but if I try via a macro, it doesn't seem to work...

              Here's my syntax:

              ReplInFiles MatchCase RegExp Recursive OutputWin Log ProjFiles "" "" "_([A-Z0-9]+)_\>"
              "_\1"

              The two parts of the RE work fine manually...

              TIA,
              Paolo
              There is no such thing as an inconsistently correct system...
              Therefore, aim for consistency; in the expectation of reaching correctness!

              6,688586
              Grand MasterGrand Master
              6,688586

                Oct 25, 2006#7

                OutputWin should be deleted from the macro because it is in real a FindInFiles parameter.

                But the correct Perl regex is really not working in the ReplInFiles command with UE v12.20+1, although it's working when executed with the replace command. So UE v12.20+1 has still problems with Perl regex engine in FindInFiles, ReplInFiles and as I could see also with Replace with All Open Files.
                Best regards from an UC/UE/UES for Windows user from Austria

                112
                Power UserPower User
                112

                  Oct 26, 2006#8

                  Thanx Mofi... Have you reported the problem already or should I?

                  The OutputWin was my mistaken attempt to keep a log of changes made...

                  I'm running a string of 10 (or so) ReplInFiles accross an entire project of 15 folder trees and several hundred files. I need to keep a log of the changes the macro made. It looks as though I can't retain a "longitudinal" log using ReplInFiles. So... Should I preface each ReplInFiles with the equivalent FindInFiles placing the result to new window for each "scan"? I'd then have a record of at least the targets of the changes....

                  Paolo
                  There is no such thing as an inconsistently correct system...
                  Therefore, aim for consistency; in the expectation of reaching correctness!

                  6,688586
                  Grand MasterGrand Master
                  6,688586

                    Oct 26, 2006#9

                    PaoloFCantoni wrote:Thanx Mofi... Have you reported the problem already or should I?
                    I don't have reported it because I don't use Perl. In the past I have reported some general Perl problems, but nothing special like that. I tested today what the IDM developers have fixed in v12.20+1 from my reports and which bugs still exist. Some general Perl related bugs I reported with macro usage are fixed, but some Perl problems still exist.

                    Your Perl regex ReplInFiles could be also done with the UltraEdit or legacy Unix regex engine. Maybe you use one of the legacy engines as workaround.

                    UnixReOff
                    ReplInFiles MatchCase RegExp Recursive Log ProjFiles "" "" "_^([A-Z0-9]+^)_^([~0-9A-Za-z_]^)"
                    "_^1^2"

                    or

                    UnixReOn
                    ReplInFiles MatchCase RegExp Recursive Log ProjFiles "" "" "_([A-Z0-9]+)_([^0-9A-Za-z_])"
                    "_\1\2"

                    I have not really tested it with ReplInFiles, but I think it will work.

                    Note: This regex will not work for a target word which is at the end of the file without a line termination because no character after the target word.

                    And my test project file (exactly workspace) does not have files in subdirectories so I could not really test it, but I think the parameter Recursive is not needed with ProjFiles.

                    PaoloFCantoni wrote:The OutputWin was my mistaken attempt to keep a log of changes made...
                    No problem. I have detected and also reported some weeks (months?) ago that the macro recorder records the parameter OutputWin for ReplInFiles according to the current state of the Find In Files option "Results to Edit Window". The wrong recorded parameter OutputWin has no influence on the execution of the macro command ReplInFiles.

                    PaoloFCantoni wrote:I'm running a string of 10 (or so) ReplInFiles accross an entire project of 15 folder trees and several hundred files. I need to keep a log of the changes the macro made. It looks as though I can't retain a "longitudinal" log using ReplInFiles. So... Should I preface each ReplInFiles with the equivalent FindInFiles placing the result to new window for each "scan"?
                    Yes, the Log option of ReplInFiles reports in the output window only which files are searched for and how many changes are done in any file. It does not report the lines with the changes. The reason is quite simply: Replace In Files can be used also for block replaces or line termination conversions or to change bytes in real binary files as I do sometimes.

                    So you better run first the 10 (or so) FindInFiles without parameter OutputWin to get a log file with the lines with the strings which are hopefully replaced then by the ReplInFiles commands.
                    Best regards from an UC/UE/UES for Windows user from Austria

                    112
                    Power UserPower User
                    112

                      Oct 26, 2006#10

                      Thanx for that Mofi...

                      Yes, I did know that that expression could be done in the other two forms but unfortunately it's the only one of the 10 that can...

                      Anyway, I'll report the problem...

                      I happened to notice that UE also reports the change count incorrectly...

                      At the bottom of the output window, it has messages like...

                      "241 changes in 201 files."

                      But that's not actually correct... those 241 changes (reviewing the list) occurred in only 3 files.

                      It should read:
                      "241 changes in 3 of 201 files."

                      Should it not?

                      Paolo
                      There is no such thing as an inconsistently correct system...
                      Therefore, aim for consistency; in the expectation of reaching correctness!

                      6,688586
                      Grand MasterGrand Master
                      6,688586

                        Oct 26, 2006#11

                        "241 changes in 3 of 201 files." would be really much better.
                        Best regards from an UC/UE/UES for Windows user from Austria

                        112
                        Power UserPower User
                        112

                          Oct 28, 2006#12

                          I've reported the bug(s).

                          For the record, v12.20a doesn't fix the problem (notwithstanding its claims to have fixed some (which?) Find/Replace issues...)

                          Paolo

                            Nov 03, 2006#13

                            12.20a+1 also doesn't seem to have fixed it either...

                            Again, not withstanding it's claims to do so...

                            Paolo

                              May 27, 2007#14

                              13.00a also hasn't fixed it...

                              I've just run a manual (not macro) "Replace in Files" over a large project and got the response in the output window of:
                              8 items replaced in 806 files.

                              Now, I would have (at least) expected that the files that had changed would be listed in the window, but no! All 806 files are listed 802 of them having 0 replacements against them.

                              Now, sometimes when I do file based Replace in Files, I get ONLY the files that changed - I haven't been able to figure out why one output and then another. I suspect that the marking of the [x] Regular Expressions box switches the output.

                              It seems to me we need an option [x] Display all files processed

                              We also need the equivalent of the Set Find Output Format (Advanced|Configuration|Search|Set Find Output Format)
                              Why it was created for the "Find in Files" and NOT for "Replace in Files", is beyond me...

                              Paolo
                              There is no such thing as an inconsistently correct system...
                              Therefore, aim for consistency; in the expectation of reaching correctness!