Skip to content

Instantly share code, notes, and snippets.

@masnick
Created January 20, 2016 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masnick/23275ed6b208c82fd3f8 to your computer and use it in GitHub Desktop.
Save masnick/23275ed6b208c82fd3f8 to your computer and use it in GitHub Desktop.
cap log c
clear
set more off
cd "/path/to/folder/"
local files : dir "`c(pwd)'" files "*.dta"
clear
foreach f in `files' {
clear
di _newline in red "Processing dataset: `f' "
use `f', replace
compress
save, replace
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment