Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: limitation of -filefilter-


From   Phil Schumm <[email protected]>
To   [email protected]
Subject   st: limitation of -filefilter-
Date   Tue, 23 Nov 2004 05:16:18 -0600

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?


-- Phil
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index