#1
|
|||
|
|||
Deleting chapters which don't contain certain words?
Hi all,
I'm working with a document which contains many chapters, and I would like to keep only the chapters which contain certain phrases (there's a fairly long list of them but an example would be 'transgender men'). Does anyone know how I could do this? Doing it manually would be quite an ordeal. Thank you! |
#2
|
|||
|
|||
How are your chapters divided?
Heading styles? Section breaks? |
#3
|
|||
|
|||
I'm not entirely sure but I think heading styles.
|
#4
|
|||
|
|||
Please attach a sample document (not a screenshot) with at least three chapters.
How to attach a screenshot or file in this forum. |
#5
|
|||
|
|||
Quote:
|
#6
|
|||
|
|||
Your document uses Heading 1 to delineate your sections. It also has a bunch of apparently unnecessary section breaks that are not relevant to our discussion.
However, it does not contain the phrase "transgender men." As an example, I will simply search for "transgender" which it does have in two sections and not in the third. I use the Navigation Pane and type "transgender" in the search box, keeping it on the Headings tab. Two show up as having that term, the third is not highlighted so does not contain the term. I right-click on the heading that does not contain the term and choose Delete. That section (everything from that heading to the next Heading 1 paragraph) is deleted. I recommend doing this in a copy and being careful of your search terms. For instance, if there had been a typo or the term "transgender man" had been used it would not be picked up in such a search. Neither would "trans men." |
#7
|
|||
|
|||
Sorry, I did not read enough.
Same process. Same warnings.
Is this going to be too tedious? |
#8
|
|||
|
|||
Thank you so much for taking the time to have a look at it. Your method is certainly one that I've thought of, but it probably would take a lot of time I'm afraid. This is firstly because I have multiple search terms that I need to keep (transgender men, transgender man, trans men, trans man, female-to-male...), so I can't just delete the chapters which don't contain, for instance, 'trans men' because I might also be deleting chapters which contain other terms that I want. The only real solution I can think of currently would be to use the search bar to find all the relevant chapters and then manually copy-paste them all into a different document, but that would be extremely tedious because there are literally hundreds of those in the actual document!
|
#9
|
|||
|
|||
Rather than copy into a different document, copy the document and delete from the copy. Perhaps prepare an index that has the terms you want and use that as a guide to the sections to be deleted.
|
#10
|
|||
|
|||
I'll have a go with that - thank you for your help!
|
#11
|
||||
|
||||
I would try to work out a workflow to do this efficiently. The best I can think of is:
1. Put each article into a Rich Text Content Control and set the tag property of each to a static phrase such as "Delete me" 2. Run a macro which searches for each of the key terms and wherever there is a hit, change the tag property of the CC it sits in to "Keep me" 3. At the end of the macro running, delete all the CC ranges that are still tagged as "Delete me"
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
chapters |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chapters in Headers | RRB | Word | 4 | 04-26-2021 03:08 PM |
deleting "s" at end of words | cinci-hal | Word | 1 | 08-27-2017 02:14 PM |
Need VBA to renumber chapters | bobbyrjw | Word VBA | 3 | 01-03-2017 12:15 AM |
How to number chapters and sub-chapters in a few clicks? | Icelandic_Boy | Word | 1 | 05-24-2016 11:33 AM |
Deleting a script in an equation without deleting the whole term | allankey | Word | 1 | 02-15-2014 07:09 AM |