Community
    • Login

    Find Criteria. :(

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.1k 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.
    • Mouaffaq Al BaghdadiM
      Mouaffaq Al Baghdadi
      last edited by

      hi, i want to find and select all paragraphs in notepad++ text file that starting with specific words and ends with specific words, i.e. paragraph starts with “dear Mr.” and ends with “best regards”, and select all results and copy it to another text file. Thanks in advance

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Mouaffaq Al Baghdadi
        last edited by

        @Mouaffaq-Al-Baghdadi

        What is your definition of a “paragraph”. Notepad++ has no such term so we need to know what you think it means.

        You can do a Find Next, then Copy, then paste somewhere else, then another cycle (FInd Next, Copy, paste), then another…and another… What I’m saying is you can’t “select all results and copy it” somewhere else…UNLESS your results contain complete lines (in which case you can do it by copying the Find results panel after you do a Find All in Current Document. Your situation sounds like it might be a candidate for this.

        1 Reply Last reply Reply Quote 0
        • Mouaffaq Al BaghdadiM
          Mouaffaq Al Baghdadi
          last edited by

          Thanks for your swift reply.

          This is a sample:

          Dear all
          1111
          Am happy to meet all of you
          It was a great experience
          2222

          Ill be here if anybody need any help
          You can call me in my mobile
          Dont forget to register with us

          1111
          awaiting you kind reply
          2222

          I want to copy all lines between
          1111 and 2222

          Result will be:

          Am happy to meet all of you
          It was a great experience
          awaiting you kind reply

          1 Reply Last reply Reply Quote 0
          • Scott SumnerS
            Scott Sumner
            last edited by

            @Mouaffaq-Al-Baghdadi:

            A way to do it would be to copy all of your original data into a new tab, and then act on that tab with the following (as the suggestion will be a destructive replacement).

            Step 1: Add a line at the top of the is new tab, containing 2222 only and then press Enter to add a line-ending to this line

            Step 2: Add a line at the bottom of the is new tab, containing 1111 only and then press Enter to add a line-ending to this line

            Step 3: Perform this Replacement action:

            Invoke the Replace dialog (default key: ctrl+h)
            Find what zone: ^2222\R(?s).*?^1111\R
            Replace with zone: make sure this is EMPTY
            Wrap around checkbox: ticked
            Search mode selection: Regular expression
            Action: Press Replace All button

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors