Chris Schmidt (crschmidt) wrote,
Chris Schmidt

Converting with sed...

Turning stylesheet CSS to inline CSS:

sed 's/class="no"/style="background-color:#cc0000"/' | sed 's/class="yes"/style="background-color:#00cc00"/' | sed 's/class="paid"/style="background-color:#cccc00"/' | sed 's/class="paidstylefeature"/style="background-color:#000066; color: #ffffff"/' | sed 's/class="allpaidfeature"/style="background-color:#aaaaff; color: #000000"/' | sed 's/class="freefeature"/style="background-color:#aaaaaa; color: #000000"/' | sed 's/td style="back/td style="border: solid 1px #000000; font-size: 11px; back/' | sed 's/td /td width="150px" height="50px" /' | sed 's/th class=".*"/th style="font-size:11px"/' > ~/public_html/blah3.htm

(result is the conversion of (Happy Birthday Fweebzors!) to the HTML in

That is one monster sed command. For me, anyway. I should actually learn how to use regexs so I can do it smaller next time ;)
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded