MATLAB Python

easyMove

Syntax

error_code = easyMove(source_dir [,'new_ppt_name'] [,'overwrite_target'] [,'remove_source'] [,'strict'] [,'blanks']) [] = optional parameters '' = parameter-value pairs

Description

EASYMOVE gathers participant data into the current computer's SPTB participants folder. This would be useful if, for example, you were aggregating data from multiple testing computers. EASYMOVE can also be used to revise participant names, sessions, and update old saved SPTB data files to the current data format.

Usage

D = easyMove(S) imports data from a source string S using regex matching. Absolute or relative paths may be used, and are case-sensitive. File import is also recursive: if a directory matches your expression, its entire contents will be imported. D = easyMove(S,param1,val1,param2,val2...) sets various optional parameters. Parameters are case-insensitive, and each string parameter must be followed by a value as indicated: 'new_ppt_name' String. When specified, all files that are processed will be given a new participant name. This will be reflected both in their file name and their contents. The altered file will be stored in the "modified" rather than "raw" directory. Default: [] 'new_session' Integer. Behaves like the "new_ppt_name" parameter but updates session number instead. Default: [] 'blanks' Boolean. Besides moving an item that was incorrectly named, it can be helpful to create empty datastruct files that, because they occur first in the search priority list, are able to block SPTB from reading in incorrectly named files, even without touching the originals. If set, this parameter will cause SPTB to move empty versions of the datastructs to the new position, rather than their original versions. Default: [] 'overwrite_target' Boolean. When set to true, files in the SPTB folder on this computer that match files in the source_dir will be overwritten without a prompt. When set to false, matching files will cause an error. When left unset, the user will be prompted for each file with a conflicting file name. Default: [] 'remove_source' Boolean. When set to true, files are moved/renamed from the source directory into the SPTB folder, rather than copied. Default: false 'strict' Boolean. As with getDataStruct, an error will be thrown when an expected parameter is missing. By setting this parameter to false, these cases will be tolerated; missing fields will be populated with empty values. Use this option at your own peril, as missing parameters may cause issues with downstream functions. Default: false