*! version 1.2 07 February 2012
help for strimplifyversion 1.2 (07 February 2012)

Title

strimplify -- convert umlauts and delete special characters in string

Syntax

strimplify string [, varmode numbers noreplace suffix(string) nocase verbose]

varmode instead of converting string, interprete it as varlist and convert any string contained in each specified variable

numbers delete numbers from string

noreplace do not replace variable in varmode, but generate new

suffix(string) suffix to append to the newly generated variable

nocase do not convert string to upper case

verbose give verbose output

Description

strimplify converts umlauts in a given string to its ascii form and deletes special characters from it. With the varmode option, it does this with all stirings in varlist instead of a single string.

The resulting string will be easy to process with string-comparison operations, which is the aim of the procedure.

Note that if string contains quotes, it has to be specified using compound double quotes.

Options

Main

varmode if specified, string is interpreted as varlist. The conversion operation will be run for each string contained inside the given variable(s).

If not specified, string will be processed as is, and the results returned in scalars.

numbers in addition to processing umlauts and special characters, delete numeric characters from string.

nogenerate instead of replacing strings in variable mode, generate new variable containing results. This variable will be named as the original, but with a suffix as specified by suffix.

suffix(string) if specified, string will be appended to the newly generated variable in varmode with the noreplace option.

If not specified, _simple is used in such cases.

nocase if specified, do not convert string to upper case letters (which is what happens by default).

verbose drops verbose output during the process. Eventually needed for debugging your syntax.

Remarks

This command is part of the NEPmgmt bundle, written to help creating the NEPS dataset files.

The source code of the program is licensed under the GNU General Public License version 3 or later. The corresponding license text can be found on the internet at http://www.gnu.org/licenses/ or in gnugpl.

Examples

Process the string tEsT$!123 and delete numbers from it:

. strimplify tEsT$!123, numbers

Process all strings in variables <stringvar1> and <stringvar2> and delete numbers from it, without converting to upper case characters:

. strimplify stringvar1 stringvar2, varmode numbers nocase

Do the same, but instead of replacing the current variables, generate new ones with the suffix _simplified:

. strimplify stringvar1 stringvar2, varmode numbers noreplace suffix(_simplified) nocase

Author

Daniel Bela (daniel.bela@lifbi.de), Leibniz Institute for Educational Trajectories (LIfBi), Germany.

Saved results

strimplify saves the following in r():

Scalars

r(oldstring) original string specified by the user (if used without option varmode)

r(newstring) converted string (if used without option varmode)

Also see

Help: NEPSmgmt