Community
    • Login

    automate task question

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.2k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ruebezahl11R Offline
      Ruebezahl11
      last edited by

      I am currentlly repeating certain set of key strokes all too often…
      Basically, I have a file with a name in each line, followed by whitespace and some info. The sequence is:
      select a range of lines, ctrl-c, scroll to a range of emtpy lines I have set aside,
      paste and then reselect the lines. Next, use find/replace panel to replace all “<space>.” by nothing (in selection is checked) - usually the find/replace panel is still in that condition
      Next, click somewhere in a blank space of the program menu (to deselect find/replace but keep selection), then ctrl-c. The truncated lines are now in the clipboard, ready for another program
      Can I somehow improve that process - the ideal case would be to select a range of lines and then type some shortcat to perform the operation

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @Ruebezahl11
        last edited by Alan Kilborn

        @Ruebezahl11

        Yes, you can automate that.

        • make a selection covering some number of whole lines
        • invoke Replace with Ctrl+h
        • start macro recording (Macro menu)
        • set up the Replace window to look like this:
          7f669d64-e29b-42f2-98f4-e2ec3b921eb0-image.png
          (the important parts are a single space character in Find what, absolutely nothing in Replace with, and In selection checked)
        • press Replace All
        • choose Copy from N++'s Edit menu
        • stop macro recording (Macro menu)
        • save your macro (Macro menu)

        When you run the Macro (it will appear on the Macro menu after you save it), it will de-spacify your selected lines, in-place, and copy them to the clipboard. You just have to manually press Ctrl+z (undo) now to get the original lines back in place. But, your goal of having the de-spacified lines in the clipboard is achieved, with less fuss than you had – probably it goes without saying that you can assign the running of a saved macro to a keycombination of your choice.

        Further detail on working with macros is HERE.

        Ruebezahl11R 1 Reply Last reply Reply Quote 3
        • Ruebezahl11R Offline
          Ruebezahl11 @Alan Kilborn
          last edited by

          @Alan-Kilborn
          Hi, many thanks - this works like a treat. In fact, I could add the undo to the macro

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA Offline
            Alan Kilborn @Ruebezahl11
            last edited by

            @Ruebezahl11 said in automate task question:

            I could add the undo to the macro

            Hmm, when I tried that with my quick experimentation, it didn’t work, but if it works for you, great.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors