Tags:
create new tag
view all tags

Question

Does anyone know of good options for batch search-and-replacing text strings across many topics or webs? I can think of a number of situations where this capability would be very useful:

  • Modifying TWiki formatting syntax to match new standards such as being discussed in UnderscoreWikiWords and RfcModifiedTWikiHeadingMarkup.
  • Changing the name of a web (and all referenced to it) across an installation.
  • Changing a variable or formatting tag throughout a web or site.

This is not something one would need to do often and I suspect it should be restricted to administrators - so perhaps some (hopefully free) stand-along perl script or program is available that can do this.

Any one have some references or ideas?

Environment

TWiki version: TWikiRelease01Feb2003
Server OS: Linux
Web server: Apache

-- LynnwoodBrown - 11 Nov 2003

Answer

Useful indeed. Best to follow up in Codev.MassUpdate

-- PeterThoeny - 12 Nov 2003

A simple non-TWiki solution is to just use Perl to do this - see WindowsInstallCookbook where it talks about re-locking the RCS files. The basic command is perl -i.bak -e 's/foo/bar/' */*.txt (from the TWiki data directory). This produces a backup file for each topic, so the *.txt.bak files would need to be deleted.

On Unix/Linux you can omit the .bak part from the Perl command, but this doesn't work on Windows. See the Perl docs for more details.

If you do try this, be sure to make a backup of your TWiki web directories before large scale tests! I have used such commands successfully but it's easy to make a large mistake...

-- RichardDonkin - 13 Nov 2003

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2004-02-01 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.