Find paragraph with matching first line and delete paragraph

Everything related to our flagship word processor.
Post Reply
scg
Posts: 1
Joined: 2023-11-09 05:46:25

Find paragraph with matching first line and delete paragraph

Post by scg »

Hello,

I'm trying to automate finding a paragraph with a matching open line 'Introductory Sentences' and then delete that paragraph. I can't work out how to do it. Is there a good place for working it out?

thanks for your help,
User avatar
martin
Official Nisus Person
Posts: 5228
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Find paragraph with matching first line and delete paragraph

Post by martin »

You could use Nisus Writer Pro macros to automate this task, but it's probably simpler and easier to use PowerFind. You would want a PowerFind search expression that looks like this:
powerfind.png
powerfind.png (34.9 KiB) Viewed 1374 times

The key is using the "Start of Paragraph" PowerFind bubble to ensure you only match this special phrase when it appears at the front of a paragraph. The other aspect is using the AnyText bubble to match the rest of the paragraph, whatever its contents may be.

After you enter the find expression you can simply do a "Replace All" with nothing in the "replace with" field to excise the unwanted paragraphs.

A few notes:
1. If you want to delete these paragraphs without leaving behind an empty line, add a "Return" to the end of your find expression to delete it too.
2. You can save this find expression for reuse via the "Saved Expressions" feature, which is also available from the popup menu.

I hope that helps! Let us know if you have any questions.
Post Reply