fixing list import issues with search and replace

This forum is for all Flare issues related to importing files or projects.

fixing list import issues with search and replace

Postby mbcohn on Wed Dec 02, 2020 8:15 pm

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

Postby mbcohn on Sun Dec 06, 2020 11:12 pm

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>
mbcohn
Jr. Propeller Head
 
Posts: 7
Joined: Mon Oct 26, 2020 4:09 pm


Return to Importing

Who is online

Users browsing this forum: No registered users and 1 guest