POV-Ray : Newsgroups : povray.off-topic : sed question : sed question Server Time
6 Sep 2024 17:20:32 EDT (-0400)
  sed question  
From: Jim Holsenback
Date: 17 Nov 2008 09:34:20
Message: <492180ec@news.povray.org>
Hello,

I'm working on a documentation migration project that involves translating a 
group of html files into MediWiki markup. I'm using an application called 
Pandoc to do the bulk of the translation, however there are some 
application-centric tags that Pandoc refuses to translate. These app-centric 
tags are essential for producing searchable indexices later on in the 
process. My idea is to enclose these app-centric tags in html comments 
notation, so that Pandoc will pass them (tags) on. As comments they remain 
in the file but the person viewing the docs won't see them, I can later 
programmatically access those tags and process them accordingly.

 The tool I want to use is "sed" .... however I'm rusty and have been 
struggling a bit.

 This sample line example shows what I need to do:

<indexentry "This part is always different>

 needs to look like this:

<!-- <indexentry "This part is always different"> -->

 the wildcarding portion of my sed statement is where I'm having 
difficulties.

 sed s\%'<indexentry*'%'<!-- <indexentry* -->'%g test.html

 gives me: <!-- <indexentry* --> "This part is always different">

Close but no cigar! It's not treating the "*" as a wildcard but passing it 
on. I'm not escaping it properly am I? I've tried more than several 
incantations but haven't had any luck. Someone's going to take one look at 
this and solve it!

Thanks Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.