[pmwiki-users] Change the content of many pages at a time

kirpi at kirpi.it kirpi at kirpi.it
Fri Dec 5 09:42:11 CST 2008


Pmwiki is so nice that we use it extensively, really.
Now, one may need to make bulk changes to the content of all/many
pages at a time. This is particularly true now that, thanks to PTVs,
we can use pmwiki pages to record fields like "Date_of_birth:
2009/10/09".

Imagine you have 300 pages in a Friends group, one per friend, and
each page contains:

    * Name: xxx
    * Surname: xxx
    * Date_of_birht: xxx
    * Email: xxx

What if I want to correct "Date_of_birht" to "Date_of_birth" to all
the 300 pages?
And, what if I want to add a "Sex:" variable just below "Surname:"?

I've been told that there are unix tools like awk[1] which can make
the trick but, as far as my experience goes and despite nice pages
like "Become an expert in 60 minutes", it turns out that it may takes
ages before you can use awk: you have to *first* study Regular
Expressions[2] (which are a very complicated beast and may take weeks
to master), and later approach awk itself.

I personally found Emacs to be a friendlier choice, although not
necessarily easy to use[3].
I just started Cookbook/BulkReplace[4], but I'm surely not able to
write about technical subjects.

My questions are:
a) Does anybody want/is_able to contribute his/her knowledge to the
Cookbook/BulkReplace page, in order to provide pmwiki users with
useful/practical advices on the matter?
b) Does anybody know of a way to use php for such a purpose, so that a
general script could be made into a recipe?


Luigi


----
[1] http://en.wikipedia.org/wiki/AWK
[2] http://www.pmwiki.org/wiki/Cookbook/RegularExpressions thanks to
Joachim Durchholz
[3] I do not know how to write "line break"
[4] http://www.pmwiki.org/wiki/Cookbook/BulkReplace



More information about the pmwiki-users mailing list