• Login
Community
  • Login

Replace "intro" for "space" in a selected text

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 3.0k Views
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.
  • A
    alcx112
    last edited by May 16, 2017, 3:01 PM

    Hello!
    I’m copying some text from a PDF and when you do that you get the text something like this:
    “Notepad++ was developed by Don Ho in September 2003.[7] The
    developer used JEXT (a Java-based text editor) at his company but,
    dissatisfied with its poor performance, he began to develop a text editor written in C++ with
    Scintilla.[7] He developed it in his spare time since the idea was rejected by his
    company”

    And I’d like it to look like this:
    “Notepad++ was developed by Don Ho in September 2003.[7] The developer used JEXT (a Java-based text editor) at his company but, dissatisfied with its poor performance, he began to develop a text editor written in C++ with Scintilla.[7] He developed it in his spare time since the idea was rejected by his company”

    So, I’d like to replace that change of line for a space. I was using the tool called “Remove unnecesary Balnk and EOL”. It does what I need but to the whole text in the file. I’d like to do it just to a selection (to keep the paragraphs the way they are in the PDF".

    So, today I found out I can search for “intros” as “\r\n” and I could deleted that “intro” and replace it for a “space”.
    I would like to do this with a shortcut. The only way I know I can do this is by recording a Macro. The problem is that I don’t know how to tell that macro to recognize a text selection.
    I recorded the Macro selecting a text and doing the replace operation, but then I tried the Macro and nothing happened :(

    What can I do to make it work?
    Thank you!

    S 1 Reply Last reply May 16, 2017, 5:19 PM Reply Quote 0
    • S
      Scott Sumner @alcx112
      last edited by May 16, 2017, 5:19 PM

      @alcx112

      It is hard from your description to tell where things go wrong. Find/Replace is a bit tricky to do in a macro; have you followed the methodology outlined here?: http://docs.notepad-plus-plus.org/index.php/Editing_Configuration_Files#Search_.2F_Replace_encoding

      1 Reply Last reply Reply Quote 0
      • A
        alcx112
        last edited by May 17, 2017, 1:48 AM

        Thanks! but I really don’t know what to do with that info :(

        S 1 Reply Last reply May 17, 2017, 12:08 PM Reply Quote 0
        • S
          Scott Sumner @alcx112
          last edited by May 17, 2017, 12:08 PM

          @alcx112

          Rereading your posting and my answer I realized that you shouldn’t need the information I provided via that link–your situation is simpler.

          I tried what I think is your situation and recording it as a macro worked for me. The key part of what I did that you may be missing is ticking the checkbox for “In selection” in the Replace tab of the Find/Replace dialog (and then pressing the “Replace All” button).

          1 Reply Last reply Reply Quote 0
          • A
            alcx112
            last edited by May 17, 2017, 3:50 PM

            You are right!
            I forgot something like that. I did itagain paying attention to those details and the Macro works!
            Thank you very much! :D

            1 Reply Last reply Reply Quote 0
            3 out of 5
            • First post
              3/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors