Hi everyone,
I wish to rename some excel files on STATA so that only the first 4 characters appear for each file. I ran the following command:
local files: dir "C:\Users\Dell\OneDrive - The University of Nottingham\DISE" files "*.xlsx"
foreach f of local files {
local fnew = substr("`f'",1,4)
!rename "`f'" "`fnew'.xlsx"
}
macro list `fnew'
But when I view the file names using the last command, I see no change in their names. Could anyone please help with this?
Thanks!
Related Posts with Renaming multiple excel files
fixed effects and constant estimatesDear All, Does anyone know the relationship among the following commands? I mean how can we adjust t…
Reverse Coding a Count VariableHi All, I hope you are doing great. I have a question about reverse coding a count variable. I have …
Question on Intraclass correlation coefficients (ICC): two-way mixed effectsHi! I wish to use ICC to look at test-retest reliability using two sets of data reported by the same…
Count by groups 5 years after the current yearDear Statalist, I am wondering if you can help me to count the number of times a given attribute is …
Reshape with two columns to rowsHi, I am trying to reshape a dataset so that the rows in variable "title" become columns, while the …
Subscribe to:
Post Comments (Atom)
0 Response to Renaming multiple excel files
Post a Comment