!747 m { p { S s = smartJoin(args); print(s); new Matches m; int renames = 0; if (match3("rename * to * in *", s, m)) { S in = unquote(m.m[0]), out = unquote(m.m[1]), f = unquote(m.m[2]); print("Renaming " + quote(in) + " to " + quote(out) + " in " + f); L tok = javaTok(loadTextFile(f)); for (int i = 1; i < tok.size(); i += 2) { if (tok.get(i).equals(in)) { tok.set(i, out); ++renames; } } saveTextFile(f, join(tok)); print("Done, " + renames + " rename(s)."); } else print("?"); } }