Skip to content

Instantly share code, notes, and snippets.

@michaelewens
Last active June 18, 2020 06:24
Show Gist options
  • Select an option

  • Save michaelewens/f8e7886efc590207b12f7323f46f3d49 to your computer and use it in GitHub Desktop.

Select an option

Save michaelewens/f8e7886efc590207b12f7323f46f3d49 to your computer and use it in GitHub Desktop.
Make reclink work...?
// These seem to fix weird errors in the reclink command in Stata (i.e., it doesn't like some characters
// Run this basic logic through your using and master strings.
// This table is your friend: http://www.asciitable.com/
** This one gets rid of all non-alphanumeric
replace yourString = ustrregexra(yourString ,`"[^a-zA-Z0-9]"',"")
** Old, but still works
replace yourString = subinstr(yourString, "$", "",.)
replace yourString = subinstr(yourString, char(44), "",.)
replace yourString = subinstr(yourString, "+", "",.)
replace yourString = subinstr(yourString, char(34), "",.)
replace yourString = subinstr(yourString, "c/o", " ", .)
replace yourString = subinstr(yourString, ")", "", .)
replace yourString = subinstr(yourString, "(", "", .)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment