title: How to use local variable inside a string in Stata
body: <p>I am trying to import multiple files in csv format into Stata. Their names follow the format "variable_2010". I want to use a loop to import and save these files. I tried the following: </p>
  
  <pre><code>foreach var in varlist a b c d {
  import "c:\`var'_2010.csv"
  save ......
  }
  </code></pre>
  
  <p>This does not work . The problem is that <code>var</code> is not recognised inside the path. How could I escape this problem? </p>