Lately I'm finding myself using -filefilter- a lot. Specifically,
I'm using it in situations where before I would have used a call to
sed (via -shell-). Although -filefilter- doesn't have the full
capability of a regexp-based utility, unlike sed I can count on it
being available to any Stata user regardless of platform.
-filefilter- does appear however to have some limitations regarding
how the file(s) are specified. First, it doesn't appear that you can
use paths in the file specifications. For example:
. filefilter /Users/pschumm/foo.txt /Users/pschumm/foobar.txt, f("a") t("b")
varlist not allowed
r(101);
Second, if I've got a "$" embedded in a file name, I can't seem to
specify the file. For example:
. filefilter foo\$bar.txt foo\$bar2.txt, f("a") t("b")
varlist not allowed
r(101);
where the "\" is (presumably) needed to escape the "$", thus
preventing macro expansion.
These two apparent limitations are currently preventing me from using
-filefilter- in several situations where I'd like to use it.
Unfortunately, since -filefilter- is a built-in, I can't inspect the
code. And unless I missed it, the help file doesn't address these
issues. Am I just missing something here, or can someone suggest a
way to work around these limitations?