<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Stata Things &#187; find</title>
	<atom:link href="http://enoriver.net/index.php/tag/find/feed/" rel="self" type="application/rss+xml" />
	<link>http://enoriver.net</link>
	<description>computing for fun and profit</description>
	<lastBuildDate>Tue, 31 Jan 2012 20:03:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Join the Statalist</title>
		<link>http://enoriver.net/index.php/2009/04/23/join-the-statalist/</link>
		<comments>http://enoriver.net/index.php/2009/04/23/join-the-statalist/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 16:51:29 +0000</pubDate>
		<dc:creator>Gabi Huiber</dc:creator>
				<category><![CDATA[Stata]]></category>
		<category><![CDATA[find]]></category>

		<guid isPermaLink="false">http://enoriver.net/?p=689</guid>
		<description><![CDATA[If you were looking up something Stata-related and Google sent you here, you may or may not be in the right place. What I know for sure is that you should definitely join the Statalist. I've benefited lots over the years from lurking there. Here's the latest example: somebody asked yesterday about an easy way to [...]]]></description>
			<content:encoded><![CDATA[<p>If you were looking up something Stata-related and Google sent you here, you may or may not be in the right place. What I know for sure is that you should definitely join the <a href="http://www.stata.com/statalist/">Statalist</a>. I've benefited lots over the years from lurking there. Here's the latest example: somebody asked yesterday about an easy way to search through several files for a given string.</p>
<p>You can do that in a few obvious ways outside Stata, depending on your operating system and on whether you use a programmer's text editor. They're all mentioned in the prompt and typically helpful responses this query received. But here's a slick way to build yourself a Stata <code>find</code> command, courtesy of longtime Statalist contributor Austin Nichols:</p>
<p><code><br />
clear all<br />
prog find<br />
version 10.1<br />
syntax [anything] [, Match(string asis)]<br />
foreach f of local anything {<br />
  tempfile t<br />
  filefilter `"`f'"' `t', from(`"`match'"') to("")<br />
  loc n=r(occurrences)<br />
  if `n'&gt;0 &amp; `n'&lt;. {<br />
    di `"`n' matches found in `f'"'<br />
    *could also display relevant lines of file here<br />
  }<br />
}<br />
end<br />
</code></p>
<p>And now let's try finding the string "version 8" inside all the ado-files in the Stata base package whose names start with a. This is Austin's own example, with some liberties I took so it would work on my computer:</p>
<p><code><br />
cd "`c(sysdir_base)'a"<br />
local t : dir . file "*.ado"<br />
find `t', match(version 8)<br />
</code></p>
<p>Try it. You'll like it. You might want to add it to your <code>c:/ado/personal</code> stash. </p>
<p>Regarding Statalist, the usual rules of polite behavior apply, but there's one I especially approve of: nobody likes a mailing list member who sends an "Out of office" auto-reply (or any auto-reply, for that matter). That stuff will get you booted, as it should (but you can always re-join, which is nice; Statalist enforces its rules with a firm, but sensible hand). Now go <a href="http://www.stata.com/statalist/">join</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://enoriver.net/index.php/2009/04/23/join-the-statalist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

