fixing list import issues with search and replace

This forum is for all Flare issues related to importing files or projects.
Post Reply
mbcohn
Jr. Propeller Head
Posts: 7
Joined: Mon Oct 26, 2020 4:09 pm

fixing list import issues with search and replace

Post by mbcohn »

So, I'm importing a bunch of files from Word that contain ordered lists.
Many of the list items (all of them, so far as I can tell) are coming in as their own lists, one item per list.
I know that this is a known issue. I have read some other posts about it.
Meanwhile, I have to deal with my own problem. And there are thousands of instances of this issue in my documents.
I started to fix the problem manually like so:
First, I search for </ol>.
Then, I look at the next search result, and see if it looks like this:

Code: Select all

</ol>
<ol>
If I see that pattern, then I delete both lines. That's because my documents would never have an ordered list that starts immediately after the end of another ordered list. That wouldn't make sense; there would always be a new heading or something in between them.

The challenge is: How can I automate this? I tried with regex search, but even the asterisk will not recognize the line break as part of a continuous string. Which is to say, I can't search for the pattern as a whole, so far as I can tell. And I also can't find it with 'Find Elements,' because you can only search for an entire element, open and closed, in that order.

This might be something to automate with a Python script or somesuch, going through the files. But I wanted to see if anyone had a solution for how to do it inside Flare first.

Of course, I'm also open to ideas about how to prevent it from happening to begin with.
mbcohn
Jr. Propeller Head
Posts: 7
Joined: Mon Oct 26, 2020 4:09 pm

Re: fixing list import issues with search and replace

Post by mbcohn »

I found the answer to my own question on another thread.

For future reference, here is the regex string to search for, and to replace with nothing:

Code: Select all

</ol>([\s]*)<ol>
Curlyshell
Propeller Head
Posts: 65
Joined: Fri Mar 01, 2019 9:14 am

Re: fixing list import issues with search and replace

Post by Curlyshell »

My experience is that Flare has trouble with line breaks in Regex. I have to do that work outside of Flare. Notepad++ is extremely helpful with bulk Regex changes!
"I'm a technical writer, not a developer," she said...
Post Reply