公卫百科  > 所属分类  >  Stata   
[0] 评论[0] 编辑

fs

fs lists the names of files in compact form. With no arguments, fs lists names of files in the current directory or folder. Otherwise, it follows file specifications. A file specification is a filename or (more commonly) a set of filenames indicated by the use of wildcards * or ?. folders is similar, but works for folders (or directories).

公卫家园

公卫考场


公卫论坛

安装:ssc install fs 公卫考场

案例:

公卫百科

I want to combine many .csv files. Each file has the name NYSEyyyymmdd.csv, where yyyymmdd is the date. For example yyyy= 1996, mm is month, e.g 01 for january, and dd is day, e.g. 01 for the first day of the month. The data are stock prices each day when the exchange is open, so even though the file names increases, there will be gaps for weekends, holidays, etc. 公卫家园

公卫百科

ssc inst fs 

cd D:\NYSE 
fs NYSE_*.csv 

foreach f in `r(files)' { 

    insheet using "`f'", clear 
    local ID : subinstr local f "NYSE_" "", all 
    gen id = "`ID'"
    save file`i', replace

} 
公卫家园

公卫百科

附件列表


0

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

如果您认为本词条还有待完善,请 编辑

上一篇 filelist    下一篇

标签

暂无标签

同义词

暂无同义词