title: Update file name in execution into data.table
body: <p>A quite straightforward question. </p>
  
  <pre><code>library(data.table)
  dt &lt;- fread("HK0001.csv", drop = 5:24)
  </code></pre>
  
  <p>the data like this:</p>
  
  <pre><code>                   Time Price Volume  Amount Flag
   1: 2016-01-04 09:05:06 105.0   9500  993700    1
   2: 2016-01-04 09:20:00 104.1  23500 2446350    0
   3: 2016-01-04 09:30:00 104.1  18500 1924550    1
   4: 2016-01-04 09:30:01 103.9  12500 1300550    0
   5: 2016-01-04 09:30:02 104.1  16118 1675233    1
   6: 2016-01-04 09:30:05 104.0  13000 1352200    0
   7: 2016-01-04 09:30:06 104.1   2500  260100    1
   8: 2016-01-04 09:30:07 104.1   1500  156150    1
   9: 2016-01-04 09:30:08 104.3    500   52150    1
  10: 2016-01-04 09:30:10 104.0   1000  104000    0
  11: 2016-01-04 09:30:11 103.9   1000  103900    0
  12: 2016-01-04 09:30:15 104.0   3500  364450    1
  13: 2016-01-04 09:30:17 104.3   2000  208450    1
  14: 2016-01-04 09:30:19 104.3   1500  156450    1
  15: 2016-01-04 09:30:20 104.4    500   52200    1
  16: 2016-01-04 09:30:21 104.4   1500  156600    1
  17: 2016-01-04 09:30:22 104.4   1000  104400    1
  18: 2016-01-04 09:30:24 104.4   1500  156600    1
  19: 2016-01-04 09:30:25 104.0   2000  208000    0
  20: 2016-01-04 09:30:27 104.1   3500  364350    1
  </code></pre>
  
  <p>Under the same folder, there are a lot such csv files whose name is also a stock code ticker. As shown in the example in the <code>fread</code> line, "0001" is a ticker name, there are "0002", "0003" and one thousand more others.  </p>
  
  <p>The question:</p>
  
  <p>I would like to update the ticker in the file name into data.table after <code>fread</code> by adding one new column. </p>
  
  <p>Now the columns are <code>Time</code>, <code>Price</code>, <code>Volume</code>, <code>Amount</code>, <code>Flag</code>. I wish to put the one column named <code>stock ticker</code> as the first column. </p>
  
  <p>I checked the following on SO which did not address the question.</p>
  
  <p><a href="https://stackoverflow.com/questions/1815606/rscript-determine-path-of-the-executing-script">Rscript: Determine path of the executing script</a></p>
  
  <p><a href="https://stackoverflow.com/questions/8547919/getting-the-name-of-a-dataframe-from-loading-a-rda-file-in-r">getting the name of a dataframe from loading a .rda file in R</a></p>
  
  <p>Thanks a lot!</p>