Copy link to clipboard
Copied
Hi, I have searched very hard for a while and not found an answer. I'm not good with any form of coding and am finding this very difficult so am grateful for any help.
I have documents with a lot of text that I import from Word; scattered throughout the text are boxed sidebars, in the following format: <box><box Header>ExampleTitle</box Header>ExampleText</box>
I need a way to search for these sidebars and at the very least apply a paragraph style to everything within <box></box>, but even better if possible, I need to also apply a different paragraph style to everything within <box Header></box Header> ...and the cherry on top would be to delete all these tags at the same time, although I could of course just search and delete the tags seperately afterwards.
I found a GREP at one point that would apply the style across the whole document, between the first <box> it found and the last </box> it found - not ideal. Obviously I need this to work in seperate bits scattered throughout the document.
Hi @Shaira, I will try to give you a quick answer, but you may find you need a more detailed answer. Here is what I would try first:
1. Use find/change to make sure that <box> starts a line, and </box> ends a line (so put carriage returns before and after if necessary.
2. Now do same as that for <box Header> — it must start and end on its own line.
Your paragraphs should look like this:
3. Now do Find Grep:
<box>\r([\s\S]*?)</box>
Change To:
$1
Change paragraph style to:
[select your "Box"
...Copy link to clipboard
Copied
Hi @Shaira, I will try to give you a quick answer, but you may find you need a more detailed answer. Here is what I would try first:
1. Use find/change to make sure that <box> starts a line, and </box> ends a line (so put carriage returns before and after if necessary.
2. Now do same as that for <box Header> — it must start and end on its own line.
Your paragraphs should look like this:
3. Now do Find Grep:
<box>\r([\s\S]*?)</box>
Change To:
$1
Change paragraph style to:
[select your "Box" paragraph style].
4. Then another find grep:
<box Header>([\s\S]*?)</box Header>$
Change To:
$1
Change paragraph style to:
[select your "Box Header" paragraph style].
See if that is any use. It may need more refinements.
- Mark
Copy link to clipboard
Copied
You have absolutely nailed it, thank you!!!!!!!!!!!!!!!!
Copy link to clipboard
Copied
Great! 👍