Hello all
This is my first post to statalist, so please forgive (but inform me of) and broaches of edict. Also, please note that I am new to Stata on OSX. I just moved from a PC last week.
I am trying to use Stata to append the ".txt" file extension onto a large number of files which are all located in the same directory. I am attempting to use OSX terminal commands to accomplish this (although if there is a Stata command that accomplishes the same thing, that might be preferable). Here is the command I am using in Stata:
! cd "/Users/nicholashallman/Google Drive/Academic/PhD (Mizzou)/Research Projects/Weather/Data/Text"; for file in *; do mv $file "$file.txt"; done
Stata returns the following response:
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
What is strange is that if I enter exactly the same command in terminal directly it produces the desired result (namely, all files in the directory "/Users/nicholashallman/Google Drive/Academic/PhD (Mizzou)/Research Projects/Weather/Data/Text" get the .txt extension appended to them). I can't for the life of me figure out why this works when entered directly into terminal but not when entered through Stata. Any help will be greatly appreciated.
This is my first post to statalist, so please forgive (but inform me of) and broaches of edict. Also, please note that I am new to Stata on OSX. I just moved from a PC last week.
I am trying to use Stata to append the ".txt" file extension onto a large number of files which are all located in the same directory. I am attempting to use OSX terminal commands to accomplish this (although if there is a Stata command that accomplishes the same thing, that might be preferable). Here is the command I am using in Stata:
! cd "/Users/nicholashallman/Google Drive/Academic/PhD (Mizzou)/Research Projects/Weather/Data/Text"; for file in *; do mv $file "$file.txt"; done
Stata returns the following response:
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
What is strange is that if I enter exactly the same command in terminal directly it produces the desired result (namely, all files in the directory "/Users/nicholashallman/Google Drive/Academic/PhD (Mizzou)/Research Projects/Weather/Data/Text" get the .txt extension appended to them). I can't for the life of me figure out why this works when entered directly into terminal but not when entered through Stata. Any help will be greatly appreciated.
Comment