title: how do I loop through file names in stata
body: <p>1) Is it possible to create a vector of strings in stata? 2) If yes, is it then possible to loop through the elements in this vector, performing commands on each element?</p>
  
  <p>To create a single string in stata I know you do this:</p>
  
  <pre><code>    local x = "a string"
  </code></pre>
  
  <p>But I have about 200 data files I need to loop through, and they are not conveniently named with consecutive suffixes like "_2000" "_2001" "_2002" etc.  In fact there is no rhyme or reason to the file names, but I do have a list of them which I could easily cut and paste into a string vector, and then call the elements of this vector one by one, as one might do in MATLAB.</p>
  
  <p>Is there a way to do this in stata?</p>