Tapatalk

running a marco on batch files

running a marco on batch files

4
NewbieNewbie
4

    Sep 16, 2004#1

    Hi. An elementary question i'm sure: I want to record a macro to remove all html tags from a very large number of files (c. 60,000). It's obvious how to run it on an open file in UE, but how do I run it on all fles in a path?

    Thanks in advance.

    6,685587
    Grand MasterGrand Master
    6,685587

      Sep 16, 2004#2

      You have two possibilities:

      1.) Use Search - Replace In Files

      The first one I have used a few days ago also for exactly what do want to do - remove HTML tags from all HTML files in a directory and it's subdirectories.
      Open one of the HTML files and try the first replace on the single file with normal replace command. If it works as you expect, execute it with the Replace In Files command on all other files. Uncheck List Changed Files for maximum speed. If you need further replaces, redo this procedure until all HTML tags were removed on all files.

      2.) Macro which opens one file after the other

      The second method is, to record all replaces on a single file. Then create a file, which contains one file name with full path per line. Only this list file is opened and the cursor is at the top of the file. Next modify the recorded macro to do following:
      • Select current line,
      • copy it to the clipboard,
      • go to beginning of next line,
      • open file with name from clipboard contents,
      • execute the replaces you recorded,
      • save the file and close it.
      • If not end of list file reached, redo all these commands.
      This method has one big disadvantage: it is extremely slow on 60.000 files.

      Quick and dirty:
      A Replace In Files with regular UltraEdit find string <*> normally is enough to remove all HTML tags, if no HTML tag is spread over more than one line. A second search for two spaces (or tabs) and replace with one space then removes the indent spaces on each line. Very dirty of course, but enough for my need a few days ago.
      Best regards from an UC/UE/UES for Windows user from Austria

      4
      NewbieNewbie
      4

        Sep 16, 2004#3

        Thanks Mofi. I can't seem to get replace <*> to work. I was hoping for a direct way of running a macro on a batch of files, but if it means forcing the macro to open one file at a time, so be it...

        Cheers (from Hong Kong)

          Sep 16, 2004#4

          Whoops, I just realized that I needed to check the regex box in order to replace <*>.

          2
          NewbieNewbie
          2

            Oct 21, 2004#5

            The syntax to run UltraEdit in batch mode is :

            Code: Select all

            UEDIT32.EXE %1 /M,E="C:\Program Files\BlueMega\MegaForm Server\ADMIN\EXE\COCJGC2.MAC"
            Where %1 is file to open and COCJGC2.MAC is macro file to be loaded.
            Cheers

            12
            Basic UserBasic User
            12

              Jun 21, 2006#6

              why commandline works with external files only???

              i testing this :

              Code: Select all

              start uedit32.exe /M="C:\test.MAC/test"
              only this works :)

              Code: Select all

              start uedit32.exe text.txt /M="C:\test.MAC/test"

              6,685587
              Grand MasterGrand Master
              6,685587

                Jun 22, 2006#7

                EllE wrote:Why command line works with external files only?
                Using MS start command is a little tricky - see my post at DOS script to start UltraEdit for details.
                Best regards from an UC/UE/UES for Windows user from Austria