Find Criteria. :(
-
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
-
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.
-
Thanks for your swift reply.
This is a sample:
Dear all
1111
Am happy to meet all of you
It was a great experience
2222Ill be here if anybody need any help
You can call me in my mobile
Dont forget to register with us1111
awaiting you kind reply
2222I want to copy all lines between
1111 and 2222Result will be:
Am happy to meet all of you
It was a great experience
awaiting you kind reply -
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 lineStep 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 lineStep 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