Johannes,
> Unfortunately, C does not allow to use e.g. %5 as a variable name,
> so currently I need to run the result through "sed s/%/_/g".
> Any ideas how to replace the % characters in maxima?
Try ssubst in the stringproc package. e.g.
load (stringproc);
ssubst ("a", "b", "Foobar");
=> Fooaar
Note that the arguments must be strings, so if you are trying to
sanitize a symbol I guess you want something like
ssubst ("pct", "%", string ('%o5));
=> pcto5
Hope this helps
Robert Dodier