[Gridflow-dev] modifying pd_help patches

Mathieu Bouchard matju at sympatico.ca
Tue Jan 4 12:51:11 EST 2005


On Sun, 2 Jan 2005, Mathieu Bouchard wrote:
> On Sun, 2 Jan 2005, Stéphanie Brodeur wrote:
> 1. change the filename: @ becomes #, and -help has to be inserted in the
[...]

BTW, it is a good idea to not do each step for all files at once. Doing
steps 1-7 for small chunks of the job at a time allows me to comment and
check you are heading in the right direction, so that your time is not
wasted.

Also, I wanted to write a program to search-and-replace some of the
changes from GF-0.7 to GF-0.8, and I swear I'm about to write it, but I
know I have, hmm, special delays sometimes, and I don't want to slow down
anyone.

So here's the tip in the meanwhile. Some text editors allow a
search-and-replace on many files at once. This is much faster than doing
it in Pd. However this means you have to edit .pd files as textfiles,
which may be a first for you, and may seem a bit hardcore...

If you can't find an interactive editor that does it on many files at
once, you could use unix commands instead, but that's even more hardcore.
If you don't want to try, just skip the rest of this email.

------------------8<--------cut-here--------8<------------------

Now if you're brave enough, an example of this would be:

perl -ni.backup -e 's/@inner \* \+ 0/#inner/;print' *-help.pd

Which would update [@inner * + 0 ...] to [#inner ...] in all help patches
at once.

Similar commands can be created for other replacements. Make sure you get
the backslashes right. The stuff between the first pair of slashes works
just like the "grep" command, if you know that one. The -i.backup is to
make backups, and the result of each sed should be verified to make sure
you didn't do any mistakes. Doing just s/#/@/ should be attempted last,
for obvious reasons.

_____________________________________________________________________
Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju



More information about the Gridflow-dev mailing list