*! version 1.2 18 June 2019
help for neps fileparseversion 1.2 (18 June 2019)

Title

neps fileparse -- Helper command to parse parameters that the neps : prefix command might use from a file name or directory path.

Table of contents

Syntax
Options
Description
Remarks
Examples
Authors
Also see

Syntax

Parse NEPS Scientific Use File parameters from dataset file path or directory path

neps fileparse { filepath | filename | directory path } [, setup replace ]

setup set parameters parsed from file or directory name as parameters for further use in the Stata session (shorthand for neps set)

replace replace already set parameters, if any (no effect unless option setup is specified)

Description

The neps fileparse command is a helper command to the neps : prefix command.
It enables users to read parameter that neps : may use lateron directly from a file specification.

The basic syntax is

. neps fileparse <path>

where <path> is either a file name,

a full file path (i.e. including a directory specification),

or a directory path holding dataset files.

Be sure to specify <path> in double quotes if it contains spaces.

Options

Main

setup if specified, parameters read from the given <path> will be directly passed on to neps set.

replace if specified in combination with option setup, neps set will be invoked with option replace.

If specified, but option setup is ommited, replace has no effect.

Remarks

When neps fileparse splits the specified <path> into parts, it does so by following a simple assumption:
A valid NEPS Scientific Use File dataset file name consists of four elements
(sub-study, basename, access level, and version, in this exact order;
see the neps : prefix help for details),
suffixed by a file extension, and possibly prefixed by a directory path.

These elements are separated by underscore characters.
Thus, a dataset name should contain three underscore characters.
A directory name holding dataset files,
to the contrary,
should only contain two underscore characters, as it does not contain a basename element.

The logic of counting underscore characters for parsing chunks is the only logic neps fileparse assumes.
There is no consistency check for the chunks being valid parameter values for the neps : prefix command.
There is not even a crosscheck if the specified <path> string represents an existing file name or directory.

This command is part of the NEPStools bundle, written to assist with 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

Display the parsed chunks from "C:\my path\SC4_pTargetCATI_D_9-1-1.dta":

. neps fileparse "C:\my path\SC4_pTargetCATI_D_9-1-1.dta"

Do the same, but directly record the chunks as parameters with neps set:

. neps fileparse "C:\my path\SC4_pTargetCATI_D_9-1-1.dta" , setup

Authors

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

Also see

neps :, NEPStools