nisus.com
https://www.nisus.com/forum/

How to delete multiple occurrences of identical paragraphs?
https://www.nisus.com/forum/viewtopic.php?f=17&t=5913
Page 1 of 1

Author:  Þorvarður [ 2015-02-05 04:50:02 ]
Post subject:  How to delete multiple occurrences of identical paragraphs?

Does anyone have a macro that deletes multiple occurrences of identical paragraphs?

From the following list (or paragraphs) I would like to be able to delete "Old Japanese literature" with a macro:

Quote:
Modern Japanese literature
Japanese literature
Old Japanese literature
Old Japanese literature
Old Japanese literature
Old Japanese literature
Old Japanese literature
English literature

so that the list will look like this:

Quote:
Modern Japanese literature
Japanese literature
Old Japanese literature
English literature

Author:  phspaelti [ 2015-02-05 05:00:19 ]
Post subject:  Re: How to delete multiple occurrences of identical paragrap

Don't need a macro. Find/Replace will do:
Code:
Find and Replace '^(.+\n)\1+', '\1', 'Ea'


Attachments:
Find identical paras.jpg
Find identical paras.jpg [ 40.4 KiB | Viewed 2739 times ]

Author:  Þorvarður [ 2015-02-06 02:02:55 ]
Post subject:  Re: How to delete multiple occurrences of identical paragrap

Excellent. Thank you, Philip. :-)

Author:  adryan [ 2015-03-05 18:46:20 ]
Post subject:  Re: How to delete multiple occurrences of identical paragrap

G’day, Þorvarður et al

Just for the record, note that Philip’s solution only works when the replicated paragraphs are contiguous. But one can easily ensure this by first using one of the Sort Paragraphs commands in the Edit menu.

Cheers,
Adrian

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/