

The syntax for that is as follows: local folder : dir “`sourcedir’” files “*.zip*”
How to open a winzip file zip#
zip files in the source directory in a local called ‘folder’. Our next step is to ask Stata to store the names of all the. Because sourcedirrefers to a local variable, we must enclose it in left and right single quotes. This is then followed by using the cdcommand as before but we just type sourcedir – the local storing the directory path – in the inverted commas. local sourcedir “C:\Users\Desktop\Stata\zipfiles\multiplefiles”

We store the working directory in a local variable named ‘sourcedir’. Loops are particularly helpful when you have a large number of files to unzip and typing a separate command for each one of them is cumbersome. To extract multiple zipped files (named ‘file4’ and ‘file5’), we make use of locals and loops.

zip files, we must specify the extension if any other format is being unzipped. cd “C:\Users\Desktop\Stata\zipfiles\others” unzipfile “file2.z”īecause Stata’s default setting for this command is to extract. z extension by once again resetting the working directory to the relevant folder. Other file formats can be extracted using the aforementioned unzipfilecommand. shell set path=”C:\Program Files\WinRAR” %path% & unrar e “file2.rar” Unzipping Other File Formats
How to open a winzip file software#
In our example, we use this command to open the WinRAR software by typing the path to where the software is installed and specifying the folder name that needs to be unzipped. This command interacts directly with the operating system.
