Changing a string in 1500 documents

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2009
Posts: 13
Reputation: externalaw is an unknown quantity at this point 
Solved Threads: 0
externalaw externalaw is offline Offline
Newbie Poster

Changing a string in 1500 documents

 
-1
  #1
Oct 4th, 2009
Hello dear people,

I have a bit of a problem, I need to change something and I am not sure how.

I need to change

(see: Codification)

To look like.

[[Codification]]

Of course the word codification can also look like

(see: PrimaryLegislation)

And then it needs to be

[[Primary Legislation]]

Can someone please write this little conversion for me? It is for MediaWiki (obviously)

I can only do the first part I think

/(see:/[[/g

But that is about as far as I get,
Last edited by externalaw; Oct 4th, 2009 at 10:32 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 69
Reputation: cfajohnson is an unknown quantity at this point 
Solved Threads: 13
cfajohnson cfajohnson is offline Offline
Junior Poster in Training

Re: Changing a string in 1500 documents

 
0
  #2
Oct 4th, 2009
Shell Scripting Syntax (Toggle Plain Text)
  1. sed 's/(see: \([^)]*\))/[[\1]]/'
Chris F.A. Johnson
http://cfajohnson.com
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 6
Reputation: versatileint is an unknown quantity at this point 
Solved Threads: 1
versatileint versatileint is offline Offline
Newbie Poster
 
0
  #3
Oct 12th, 2009
sed 's_(see: Codification)_[[Codification]]_'
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 843 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC