Cleaning out Span tags from HTML files

0

I have a giant number of span tags to clean out of HTM files due to a conversion from RoboHelp to Flare. Here is an example:

<span class="span_1">ANYWORD</span>

A large number of the span tags need to be replaced with bold tags:

<b>ANYWORD</b>

I have tried several of the suggestions in this site for using Notepad to work and can't get any of them to work.

I have Notepad, Dreamweaver, Flare to use to do the job. Can anyone help me?

Carrie Pocklington

Posted 2013-05-09T16:45:39.110

Reputation: 1

Please explain what you've already tried in more detail. Also note that you have to escape HTML tags here with backticks, or by indenting them with 4 spaces. – slhck – 2013-05-09T16:59:00.060

3A simpler solution, if all you need is for the text to appear in bold face, might be to add span.span_1 { font-weight: bold; } to whatever CSS file applies to these documents. Is there a reason why that wouldn't work? Considering the tools you have available, it's going to be a relatively difficult process to convert the tags themselves, so if you can get the desired result via a one-line CSS change, that's what I'd recommend. – Aaron Miller – 2013-05-09T17:12:05.720

Answers

2

Go download a tool called grepWin

In grepWin, first test this regex

<[/]?(span|o:p|font)[^>]>|(class|style)="[^>]"|(.*?)|| |(width)="([0-9]+)"

enter some example code into the "paste text to test regex" box to make sure the regex will match all of the various span tags. Here is a screenshot of what mine looks like

grepwin regex

As you can see, I used your example text string of

 <span class="span_1">ANYWORD</span>

If the reg ex matches your span tags, then close the regex tester and search and replace using the same string I gave above and do a search and replace across all of the files.

I highly recommend that you do this on a backup copy of the source files :)

May I ask, are you a technical writer? I have a background in technical writing and this just screams documentation to me :)

Richie086

Posted 2013-05-09T16:45:39.110

Reputation: 4 299

Did this work for you Carrie? Please mark it as the answer to your question if so. – Richie086 – 2013-05-10T18:37:00.340