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
Panel data (i , j and t ) 2SLS using fixed effects when endogenous variable only varies over timeI have emissions data on c.1300 firms, over 10 years, across 27 EU countries. I am looking at the re…
Problem with converting a cross-sectional dataset into panelGood afternoon, Attached is an extract of my dataset. I have cross-sectional data with two variable…
Id variable stored in double formatHello Stata members, I am analysing dataset in which pid is stored in double format. Since I want t…
Generating an average of 3 x variables with a rule that at least 2 need to not be missingHi Folks, simple question here that I can't get my head around. I have 3 x blood pressure values pe…
Reshaping dta from long to wide formatHi there, I am fairly new to Stata. I am needing help in reshaping a database from long to wide. I h…
Subscribe to:
Post Comments (Atom)
0 Response to Renaming multiple excel files
Post a Comment