Macro or search/replace expression to remove redundant spaces?

Macro or search/replace expression to remove redundant spaces?

16
Basic UserBasic User
16

    Mar 27, 2006#1

    I'm messing around with pspad (a very good free editor http://www.pspad.com/en/screenshot.htm) and one thing it has that I really like is two quick menu options that

    1) Remove Redundant blank lines
    2) Remove Redundant space

    The first one I figured out how to do with a macro I found while searching these forums (although I have to figure out how to get it to work in just selected text not the whole document).

    Since I stink with regular expressions, can someone help with the latter - removing redundant spaces? That is if there is more than one space between a letter/word, I'd like it stripped out so that just one space remains. (I'd post this in the macro forum but not sure if it can maybe be done easily with search/replace?)

    Thanks for any help.

      Mar 27, 2006#2

      Duh.. I just modified my redundant blank lines macro and this works:

      Top
      TrimTrailingSpaces
      Loop
      Find " "
      Replace All " "
      IfNotFound
      ExitLoop
      EndIf
      EndLoop


      Stupid question though... How do I quickly execute different macros? It seems like I have to load one up first before I can run one? Shouldn't there be a way to easily choose to run any of your saved macros?

      206
      MasterMaster
      206

        Mar 27, 2006#3

        From the Help:

        The Macro Set Auto Load command allows you to specify a macro file that should be loaded automatically when UltraEdit is started.
        Software For Metalworking
        http://closetolerancesoftware.com

        16
        Basic UserBasic User
        16

          Mar 27, 2006#4

          Hmmm, isn't a macro file a collection of different macros? What I'm wondering is how do I execute the different macros I have in that file? It seems like I'm only able to execute the one macro that I see when I go to "edit macro." I must be missing something really simple, since I'm sure there is a way to quickly execute your user defined macros?

          206
          MasterMaster
          206

            Mar 27, 2006#5

            View > Views/Lists

            Check the Macro List to make it visible - then double-click the macro you want to run. You can also use a toolbar button to toggle the visibility of the list. You can't assign individual macros to toolbar buttons, unfortunately.
            Software For Metalworking
            http://closetolerancesoftware.com