Forum Discussion
Cell has a list wrapped in html. Split list into 2 separated by special character
Patrick2788 Did you have any luck with this?
<span style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14.4px;">
- Syed_Asad_AbbasMar 14, 2023Copper Contributor
What if we use BS4 to get clean text easily?
- JCountrymanMar 10, 2023Copper Contributor
Patrick2788 I know Plans and Options are getting a contant so can you use those as delimiters?
- Patrick2788Mar 10, 2023Silver Contributor
There's too much variation in the CSS. It takes a ridiculous formula to go from the below left to the below right for the Plan:
I'm limited with a choice of delimiters for TEXTBEFORE/TEXTAFTER because some of those tags appear elsewhere or with additional tags. There's not enough of a pattern to pick the text out cleanly. As you can see from the above, there's still a few tags in the 'after'. SUBSTITUTE can pull those out, but how many different possibilities might there be to look for with the CSS?
The benefits information is more difficult because it contains more style CSS that often changes the name of the font type and size. Lots of things to look for - theoretically possible but if I'm writing the formula for all scenarios it becomes a question if manual extraction would be easier.
- JCountrymanMar 10, 2023Copper Contributor
Patrick2788 You were able to strip out the html and css before. Is that a problem now because of my changes?
- Patrick2788Mar 10, 2023Silver ContributorI'm afraid it's the same issue. I've explored online tools that can make the CSS neater to an extent but it doesn't do us any favors for working with it in Excel. The best solution may be a tool that can extract text from CSS.
- JCountrymanMar 10, 2023Copper Contributor
This is a full list. I think we could use Plan and Optional as a pattern to clean each string.
For the css styling we can delete it all so it is just text. I have to export the files out in a text format which I need to do a data merge in indesign
Will this work with your script?