![stata citrix on mac how to import data file stata citrix on mac how to import data file](https://support.csbs.utah.edu/_resources/images/virtual-lab-troubleshooting/download-5.png)
- Stata citrix on mac how to import data file code#
- Stata citrix on mac how to import data file windows#
Stata will automatically convert between forward slashes and backslashes depending on what kind of computer it's running on, so your code will even work if it's run on a different kind of computer. That means you can move it to a different location or send it to someone else, and as long as they make the project's folder the working directory all your code will work without any changes. If you put all the files related to a given project in a single folder (or its subfolders), always make that folder the working directory before you do anything with the project, and use relative paths in all your do files, then your project will be portable. In Linux or MacOS, " ~" is short for your home directory. This means "go up one level, from c:\users\bbadger\dissertation\dofiles to c:\users\bbadger\dissertation, then go down into the data folder to find the rawdata.dta file."Ī single period, ". " means "go up one level." If the working directory were c:\users\bbadger\dissertation\dofiles then the path to the data file would be: Of course this wouldn't work if the working directory were c:\users\bbadger\ instead. If the working directory is c:\users\bbadger\dissertation, the relative path to the same file is: users/bbadger/dissertation/data/rawdata.dtaĪ relative path starts with just the name of a folder, which is assumed to be a subfolder of the working directory. For example:Ĭ:\users\bbadger\dissertation\data\rawdata.dtaĪn absolute path in Linux or MacOS starts with a forward slash, representing the root directory, and puts a forward slash between each folder:
Stata citrix on mac how to import data file windows#
In Windows an absolute path typically starts with a drive letter followed by a colon, and then puts a backslash between each folder. An absolute path starts at the root and lists all the folders and subfolders needed to get from there to the location of the file or folder. In Windows, if you start Stata by double-clicking on a Stata file, the working directory will be set to the location of that file, making this easiest way to get to work in Stata.Ī path specifies the location of a file or folder. Where path should be replaced by the path to the folder you want to make the new working directory. You can change the working directory with the cd (change directory) command: If you save a file without specifying a location, Stata will put it in the working directory. If you try to load a file without specifying its location, Stata will look for it in the working directory. Think of it as your current location in the file system hierarchy. Stata keeps track of a working directory, which is shown in the lower left corner of the Stata window. In Linux or on a Mac, it's just called the root directory. In Windows the root of the tree is usually a drive letter, like C: or U.
![stata citrix on mac how to import data file stata citrix on mac how to import data file](https://support.citrix.com/files/public/support/article/CTX226351/images/0EM0z000000Avlo.png)
But research projects with their many interdependent files require that you pay attention to where the files are located and how they're organized.Ī file system consists of folders (also known as directories) that can contain files and/or other folders, all organized in a hierarchy or "tree." A folder that is contained in another folder is also called a subfolder. You may never have given file systems much thought-most applications these days try to keep you from having to. Most data sets you'll work with will be files that are stored in a file system. In this section we'll discuss how to get data sets into Stata. This is part two of Data Wrangling in Stata.