Stata download file from web

Stata download file from web

stata download file from web

Jan 18, · However, you can download and install a Stata package on a local Let's figure out web-aware, allowing reading of datasets (and other files). Import from the file system or a url; Change column data types; Skip or include-​only columns; Rename the data set; Skip the accessType=DOWNLOAD and selecting "Import". Importing data from SPSS, SAS and Stata files. The integration of Stata with web applications can be of great use in some contexts. as well as the transformation of Stata dialog box .dlg) files into web-​ready HTML / CSS Author & abstract; Download; Related works & more; Corrections. stata download file from web

Andrew J. Dyck wrote a nice post on his blog on how to Download and unzip data files from Stata. He writes

Recently, I’ve been using Stata’s -shp2dta- command to convert some shapefiles to stata format, grabbing Lat/Lon data and merging into another dataset. There were several compressed shapefiles I wanted to download contained in a directory from the web. I could manually download each file and uncompress each one but that would be time consuming. Also, when the maps are updated, I’d have to do the download/uncompress all over again. I’ve found that the process can be automated from within Stata by using a combination of -shell- and some handy terminal commands. &#;

You should read the rest of his post. He goes on to show how you can script with Stata to automate shelling out to download and unzip a series of files from a website, and he introduces you to some cool Unix-like utilities for Windows.

We here at StataCorp use Stata for tasks like this all the time. In fact, we have built some tools into Stata to allow you to do much of what Andrew described without ever having to leave or shell out of Stata.

For example, Stata can access files over the Internet. Stata has a copy command. And, as of Stata 11, Stata can directly zip and unzip files and directories.

Putting all of those capabilities to use, you can accomplish Andrew&#;s goal by writing code directly in Stata such as

copy rushbrookrathbone.co.uk rushbrookrathbone.co.uk copy rushbrookrathbone.co.uk rushbrookrathbone.co.uk unzipfile rushbrookrathbone.co.uk unzipfile rushbrookrathbone.co.uk

If there were a large number of files you wished to download and unzip, and they were all named in a regular manner (say, &#;rushbrookrathbone.co.uk&#; through &#;downloadzip&#;), you could bring them all down and unzip them directly in Stata with a 4 line loop:

forvalues i = 1/ { copy rushbrookrathbone.co.uk`i'.zip download`i'.zip unzipfile download`i'.zip }
Источник: [rushbrookrathbone.co.uk]

Stata download file from web

1 thoughts to “Stata download file from web”

Leave a Reply

Your email address will not be published. Required fields are marked *