AskiaTools via the Command Line
AskiaTools can be used via the Command line. You'll find below a list of the properties available when using the product in this way:
Definition
Here the list of arguments which can appear in the command line to start AskiaTools:
Parameter | Type | Description | Value |
{None} | String | Path of survey file, QES, specified between quotes " | |
/type: | Integer | Defines the type of survey and/or data | 0: QES 1: in SQL Server (Legacy format) 2: inverted data format 3: Data stored in SQL Server (new SQL format) 4 : Data stored in WebInterviews SQL database |
/url | String |
CcaWebAPI URL to use when opening a live survey. /url:"https://MyServer/CcaWebAPI" [from v5.4.9.0] |
|
/username | String |
Supervisor's user name used to connect the CcaWebAPI when opening a live survey /username:"Supervisor" (used by /url) [from v5.4.9.0] |
|
/password | String |
Supervisor's password used to connect the CcaWebAPI when opening a live survey /password:"Supervisor pwd" (used by /url and /username) [from v5.4.9.0] |
|
/webtable | String |
Indicates the webinterview SQL table to use when exporting data from WebInterviews (used by /type:4) |
/addcolumn | String | String that specifies which column should be added on the fly. (used by /exportdelimited) |
|
/additionalfilter | String | String that specifies which interviews are selected. | |
/after | String | Indicates that only interviews whose start interviews is after the indicated string are selected./after:2019-10-01 |
|
/allowwrite | - |
Flag use to allow a verification scripts to change interview data. (used by /runverification) [from v5.6.0] |
|
/alwayspoint | - | Flag used to make sure the decimal point is always `.` and not a comma. | |
/analyseincompletes | - |
Flag used to request a report on drop outs : http://analysishelp.askia.com/incomplete_data_analysis The following parameters can be used : |
|
/attemptsPerQuestion | Integer |
Indicates the number of times a generation is attempted for a question when getting an entry error (default 10). (used by /generateinterviews) [from v5.6.0] |
|
/before | String |
Indicates that only interviews whose start interviews is before the indicated string are selected. /before:2019-10-01 |
|
/closeddk | Integer |
Parameter indicating the value of DK for closed questions /closeddk:999 (used by /exportsav) |
|
/closedtype | Integer | Value that indicates how closed modalities are exported. (used by /exportdelimited) |
1 : order 2 : caption 3 : entry codes 4 : entry codes numeric |
/compact |
- |
Flag used to compact and repair a QES file. (only supported by Tools.exe 32 bit) |
|
/completes | - | Flag used to indicate if the selection should include the completes interviews | |
/completesonly | - | Flag indicating that only completed interviews should be imported. (used by /mergeinterviews) |
|
/createclosed | - | Flag used to transform a numeric or open-ended question into a closed question by finding all values. The following parameters can be used : /questions, /inverted, /questioncaption, /shortcut, /delete, /nohide |
|
/createloop | - | Flag used to transform a set of questions into a loop. The following parameters can be used : /questions, /inverted, /modalities, /questioncaption, /shortcut, /delete |
|
/createmultiple | - | Flag used to transform a set of questions into a multiple question. The following parameters can be used : /questions, /inverted, /modalities, /questioncaption, /shortcut, /delete, /noyes |
|
/datafile | String | String used to specify the additional file or directory or DB connection.
/datafile:"C:\ThisFile.xml" |
|
/definitionfile | String |
String that indicates the path of the stacked export definition file (used by /runverification) |
|
/delete | - |
Flag used to indicate if interviews should be deleted after having been moved when using /mergeinterviews. |
|
deletevariable | - | Flag used to delete questions with a matching file from a QES file.
Tools.exe "C:\MyDirectory\Delete.qes" /deletevariable /datafile:"C:\MyDirectory\Delete.xml |
|
/deleteduplicates | - |
Flag used to request a removal of duplicate interviews matched by seed, agentID and start interview |
|
/deleteinterviews | - |
Flag used to request a deletion of interviews QES. |
|
/detailed | - |
Flag used to indicate if the export indicates the modalities |
|
/developleveldepth | Integer |
Value that specifies whether loops are to be developed in AskiaAnalyse. (used by /importdimensions) [from v5.6.0] |
0 : all loops are developed (default value) 1 : none of the loops are developed 2 : only grids are developed |
/directory | String |
A string to specify where the files will be generated. |
|
/entrycodeformultiple | - |
Flag used to create multiple shortcut with entry codes. /entrycodeformultiple:1 (used by /exportsav) |
|
/excludequestions | String |
A string that specifies which questions will be excluded from the export. [from v5.4.8.0] |
|
/executequery | - |
Flag used to run an export to SQL table. The following parameters can be used : /datafile, /query /completes, /incompletes, /additionalfilter, /datafile, /before, /after |
|
/excluderegex | String | A string to specify which questions will be excluded from the export based on a regular expression. [from v5.4.8.0] |
|
/exitonerror | - | Flag used to indicate that the run should be interrupted if an error is encountered (used by /runmacro) | |
/exportdat | - |
Flag used to export interview files (.dat files) to a directory. The following parameters can be used : |
|
/exportdatamap | - | Flag used to export the simplified datamap of a survey. The following parameters can be used : /datafile, /detailed |
|
/exportdelimited | - | Flag used to request an export in ASCII delimited. The following parameters can be used : /completes, /incompletes, /additionalfilter, /datafile, /sepquestion, /sepresponse, /closedtype, /questions, /unicode, /before, /after, /multipleasbinary, /semiopen, /repeatmultipleseparator |
|
/exportdimensions | - |
Flag used to request an SPSS Dimensions export. [from v5.6.0] |
|
/exportdkasnormal | - | Flag to prevent system closed DKs to be exported as 0 (used by /exportsav) | |
/exportfixedlength | - | Flag used to request an export in ASCII fixed length using the simplified data-map. The following parameters can be used : /completes, /incompletes, /additionalfilter, /datafile, /before, /after | |
/exportmultimedia | - | Flag used to export multi-media files (pictures, sounds, etc..) from open-ended questions into a directory using the /datafile naming pattern . The following parameters can be used : /additionalfilter, /completes, /incompletes, /before, /after |
|
/exportfield | - | Flag used to request an export to an Askia field survey (SQL format) through the CcaWebAPI (used by /targetUrl, /targetUserName, /targetPassword) [from v5.6.0] |
|
/exportinverted | - | Flag used to request an export to an inverted Askia survey (QEX file format) [from v5.6.0] |
|
/exportperidata | - |
Flag used to request a peri data (system fields) export (used by /fields) [from v5.6.0] |
|
/exportqes | - | Flag used to request an export to an Askia survey (QES file format) [from v5.6.0] |
|
/exportsav | - | Flag used to request an export in SAV format. The following parameters can be used : /completes, /incompletes, /additionalfilter, /datafile, /preventreindexing, /keepunderscores, /prefixloopitems, /exportdkasnormal, /before, /after |
|
/exporttiming | - | Flag used to request an export of the timing of the questions. The following parameters can be used : /completes, /incompletes, /additionalfilter, /datafile, /idquestion, /before, /after |
|
/exporttripleS | - | Flag used to request an export in tripleS (2.0) format. The following parameters can be used : /completes, /incompletes, /additionalfilter, /datafile, /before, /after |
|
/fields |
String | String that indicates the fields, among the list below, to select in the peridata export separated by a semi-colon.InterviewID AgentId StartInterview EndInterview Seed CallId Completed LanguageId KeyStrokeCount ErrorsOnVerifyCount Guid LastResult LastSubResult CallCount Revision WebIdentity Resolution Capabilities Broker BrokerPanelId Longitude Latitude PanelId ListId StartInterviewUTC EndInterviewUTC StartInterviewUTCOffset EndInterviewUTCOffset LastSeenQuestion DeviceId ClickCount Speed Duration FraudInformation ExternalCalls CollectionMode (Used by /exportperidata) [from v5.6.0] |
|
/forceonerror | - | Flag used to indicate that the errors should be ignored. (used by /runmacro) |
|
/generate | - | Flag used to indicate if the datamap should be generated if not present (it's not saved) (used by /exportfixedlength and /exportdatamap) |
|
/generateinterviews | - |
Flag used to request a random data generation [from v5.6.0] |
|
/groupdk | - | Flag to indicate that all modalities defined in systemdk should be coded as the system DK (code -1) (used by /importpkd, /importdimensions and /importtriples) |
|
/idquestion | String | String that indicates the shortcut for the question used as an ID. (used by /deleteduplicates, /exporttiming, /overwrite, /importinnewlevel, /mergequestionnaireusingid) |
|
/importado | - | Flag used to request an ADO importation | |
/importdat | Flag used to request an import of AskiaWeb .dat interviews. The actual directory should be specified in the /datafile parameter |
||
/importdatadelimited | - | Flag used to request an import into an existing QES file. The following parameters can be used : /datafile, /sepquestion, /sepresponse, /closedtype, /alwayspoint |
|
/importdimensions | - | Flag used to request an import of any SPSS dimensions file into inverted QES file. The actual Dimensions connection string should be specified in the /datafile parameter |
|
/importfixedlength | - | Flag used to request an import in ASCII fixed length using the simplified data-map. The following parameters can be used : /datafile |
|
/importinnewlevel | - |
Flag used to request the import of a survey into a new level. The matching is done using a question whose shortcut is defined in the parameter /idquestion. The new loop's shortcut is defined by the parameter /shortcut . |
|
/importpkd | - | Flag used to request an import of a PKD file into inverted QES file. The actual PKD file should be specified in the /datafile parameter |
|
/importsav | - | Flag used to request an import of an SPSS sav file. The sav file should be specified in the /datafile parameter. The following parameters can be used : /datafile, /inverted, /noscaled |
|
/importtriples | - | Flag used to request an import of a XML Triple-S file. The Triple-S file should be specified in the /datafile parameter |
|
/importxmlinterviews | - | Flag to import XML interviews done in CAPI mode (AskiaFace). | |
/incompletes | - | Flag used to indicate if the selection should include the incompletes interviews | |
/inverted | - | Flag used to indicate if the data should be read or written from / into the inverted data format (used by /importtriples, /importsav, /createloop, /createmultiple, /createclosed, /importado ) |
|
/keepunderscores | - | Flag used to ensure the underscores are kept in the shortcuts (used by /exportsav) | |
/language | String |
Value that specifies the language abbreviation or code that will be used. /Language:”FRA” (used by /importtriples, /importsav, /importdimensions, /exporttriples, /exportsav, /exportdatamap, /exportdelimited, /exportdimensions) [from v5.5.3.0] |
|
/logfile: | String | String indicating the path of the file that should be used as a logfile for reporting errors (errors will be appended at the end). |
|
/markascomplete | - | Flag used to request a selection of interviews to be marked as complete. The following parameters can be used : /additionalfilter, /setquestion, /setvalue, /before, /after |
|
/markasincomplete | - | Flag used to request a selection of interviews to be marked as incomplete. The following parameters can be used : /additionalfilter, /setquestion, /setvalue, /before, /after |
|
/maxdiscrete | Integer | Indicates the maximum number of discrete values, above which the imported question will be considered a numerical question (default 10) (used by /importado) | |
/maxresponse | Integer | Indicates the maximum number of responses, above which the imported question will be considered as a closed question (default 20) (used by /importado) | |
/mergeinterviews | - | Flag used to request a merge of interviews QES. The following parameters can be used : /sourcepath, /sourcesurveyconnection, /sourcesurveyid, /mergetype, /delete, /preserveid, /completesonly, /additionalfilter |
|
/mergequestionnaire | - | Flag used to merge two surveys which have the same number of interviews . The following parameters can be used : /sourcepath, /sourcetype, /sourcesurveyconnection, /sourcesurveyid |
|
/mergequestionnaireusingid | - | Flag used to request the import of a survey and data with an ID into a new level. The matching is done using a question whose shortcut is defined in the parameter /idquestion. The following parameters can be used : /idquestion, /sourcepath, /sourcetype, /sourcesurveyconnection, /sourcesurveyid |
|
/mergetype | Integer | Value specifying the merge type to use. | 0 : assumes questionnaires are superposable 1 : using shortcuts and entry codes 2 : using internal question and response ids |
/modalities | String | A string to specify the modalities (string separated by ;) or the loop items of the question created by /createmultiple or /createloop | |
/multipleasbinary | - |
Flag that indicates multiple questions are exported as separate questions for each responses (0/1) (used by /exportdelimited) |
|
/multipletype | Integer |
Value indicating which format should be used to export multiple closed questions (used by /exportsav) |
0 : use question ranking flag (check if the question is ranked - default behaviour) 1 : always use dichotomy 2 : always use ranking (export with the full list of responses as a ranking) |
/multipleseparator | String |
A string to specify the separator of multiple closed questions. /multipleseparator:”_” (used by /exportsav) |
|
/nohide | - | Flag used to indicate that the used questions are not hidden in analyse, if /delete is not used (used by /createclosed) |
|
/noscaled | - | Flag used to indicate that the imported single questions should not be marked as scaled (used by /importsav) |
|
/noyes | - | Flag used to specify if the multiple closed questions in /createmultiple are defined as No / Yes instead of Yes / No (default) | |
/numericDK | String |
String to indicate if a numeric value should be interpreted as a system DK (used by /importpkd, /importdimensions and /exportsav) [from v5.6.0] |
|
/numOfInterviews | Integer |
Indicates the number of interviews you want to randomly generate (default 100). (used by /generateinterviews) [from v5.6.0] |
|
/opensize | Integer |
Value that specifies the size of open ended. The command line default is set to 1024. /opensize:2048 (used by /exportsav) From v5.6.0 /opensize:-1 auto detects the open ended questions' size |
|
/overridemultiple | - |
Flag used to force the loop creation if the source questions have less than 3 items. (used by /createloop, /regex) |
|
/overwrite | - | Flag used to request an overwrite using a question ID and an ASCII file. The following parameters can be used : /datafile, /idquestion, /sepquestion, /sepresponse, /closedtype |
|
/overwriteifvisible | Integer | Value to indicate if a question data should be re-generated when it’s already filled if it’s visible.
(used by /generateinterviews) [from v5.6.0] |
0 : option deactivated 1 : option activated (default) |
/overwritewithsql | - | Flag used to request an overwrite of a question using a matching SQL table. The following parameters can be used : /datafile (the connection), /query, /sourcequestion, /targetquestion, and for the selection of interviews: /completes, /incompletes, /additionalfilter, /before, /after | |
/overwritewithtable | - | Flag used to request an overwrite of a question using a matching ASCII table. The following parameters can be used : /datafile, /sepquestion, /sourcequestion, /targetquestion, and for the selection of interviews: /completes, /incompletes, /additionalfilter, /datafile, /before, /after | |
/pid | String | Process ID : an identifier that will be used when reporting error in the logfile | |
/prefixloopitems | - |
Flag used to prefix captions with loop items (used by /exportsav) |
|
/prefixsubquestions | - |
Flag to indicate that sub-question will be prefixed by their parent chapter or loop (used by /importpkd and /importdimensions) |
|
/preservecase | - | Flag to indicate that the shortcuts case should be kept when exporting to SAV format./preservecase:1(used by /exportsav) [from v5.6.0] |
|
/preserveid | - | Flag used to indicate if the IDs of the interview should be kept and not the auto increment property. (used by /mergeinterviews) |
|
/preventreindexing | - | Flag used to prevent shortcuts being incorrectly reindexed. (used by /exportsav) |
|
/query | String |
String that indicates the SQL query used during the ADO importation (used by /importado and /overwritewithsql) |
|
/questioncaption | Integer | Value that indicates which question caption should be used on the first row. (used by /exportdelimited) |
1 : shortcut 2 : short caption 3 : long caption |
/questioncaptionloop | Integer |
Value that indicates which loop caption should be used on the first row. (used by /exportdelimited) |
1 : entry code 2 : order 3 : caption |
/questioncaptionresponse | Integer |
Value that indicates which response caption should be used on the first row. (used by /exportdelimited) |
1 : entry code 2 : order 3 : caption |
/questioncaptionseparator | String |
A string to specify the delimiter used on the first row to separate loop caption and iterations or question caption and answers when multiple as binary. (used by /exportdelimited) |
|
/questions | String | String to specify which questions will be used: you can use a prefix and all questions whose shortcut start by this will be selected or you can separate shortcuts by `;` (Used by /exportdelimited, /exportsav) |
|
/questionselection | String | A string that specifies which questions will be exported based on their properties. (Used by /exportdelimited, /exportsav, /exporttripleS, /exportqes, /exportinverted, /exportfield/exportdimensions) [from v5.6.0] |
|
/quotasource | Integer |
Value to indicate the quota source that should be used by the RDG (used by /generateinterviews) [from v5.6.0] |
0 : no quotas 1 : quotas from QEX file 2 : quotas from live survey |
/randomseed | Integer | Value to indicate which reproducible way of generating interviews. (used by /generateinterviews) [from v5.6.0] |
|
/reducedsurvey | - |
Flag that indicates if you want to run the scripts on a sub-survey containing only the questions referred in the script (fast option) (used by /runverification /runedits) [from v5.4.9.0] |
|
/regex | String | A string to specify which questions will be selected in the export based on a regular expression. | |
/removehtml | - |
Flag that removes all HTML tags from the survey captions. (used by /exportdelimited, /exportsav, /exporttriples, /exportqes) |
|
/removeaskiascript | - |
Flag that replaces in-line Askia script used in the survey captions with "_". (used by /exportdelimited, /exportsav, /exporttriples, /exportqes) |
|
/repeatmultipleseparator | - | Flag that always exports the same number of separators for multiple question. | |
/respondentid | String |
String that specifies the Respondent ID. /respondentid:”Respondent.Serial” (used by /importdimensions) |
|
/routingspeed | Integer |
Value to indicate if the speed of the routings should be logged (possible values 0 or 1, default 0). (used by /generateinterviews) [from v5.6.0] |
|
/runedits | - |
Flag used to request a run of the edits. You need to use both parameters /completes & /incompletes if you want to run edits on all interviews. (used by /completes /incompletes /additionalfilter and /reducedsurvey). |
|
/runmacro | - | Flag used to request the run of a macro to create multiple question and loops. The following parameters can be used : /datafile, /isExitOnError, /isForceOnError |
|
/runverification | - | Flag used to run a verification script (used by /completes, /incompletes, /additionalfilter, /before, /after) [from v5.4.9.0] |
|
/samesizeloopentrycode | - |
Flag indicating that loop items entry codes should have the same size. /samesizeloopentrycode:1 (used by /exportsav) |
|
/sandbox | String |
String that indicates the directory of the Json file generated by the verification script when using the method `WriteToJson()` /sandbox:"C:\MyDirectory" (used by /runverification) [from v5.6.0] |
|
/SaveIfScreenOut | Integer |
Value to indicate if the interview should be saved if screened out. (used by /generateinterviews) [from v5.6.0] |
0 : option deactivated 1 : option activated (default) |
/SaveIfTooManyAttemps | Integer |
Value to indicate if the interview should be saved if too many attempts for a question.
[from v5.6.0] |
0 : option deactivated 1 : option activated (default) |
/scenario | String |
String that indicates the name of the scenario used for the RDG.
[from v5.6.0] |
|
/semiopen | - | Flag specifying that semi-open data should be exported. (used by /exportdelimited) |
|
/sepquestion | String | String to specify the question separator in an ASCII file. (tab by default) (used by /exportdelimited) |
|
/sepresponse | String | String to specify the response separator for a multiple question in an ASCII file. (comma by default) (used by /exportdelimited) |
|
/setquestion | String | Sting indicating the shortcut of the question that will be updated when the interview is marked as complete / incomplete (used by /markascomplete, /markasincomplete, /setvalue ) |
|
/setvalue | String |
String that indicates the value taken by the question that will be updated when the interview is marked as complete / incomplete /setquestion:"Q1" /setvalue="1" (used by /markascomplete, /markasincomplete, /setquestion ) |
|
/shortcut | String | A string to specify the shortcut of the question created by /createloop, /createclosed, /createmultiple, /importinnewlevel | |
/shortcutpostfixtype | Value |
Value indicating how the shortcut of multiple closed questions should be postfixed. (used by /exportsav) |
0 : postfix with order 1 : postfix with entry codes 2 : postfix with same size entry codes |
/sourcepath | String | String used to specify the source QES file. (used by /mergeinterviews, /mergequestionnaire, /mergequestionnaireusingid) |
|
/sourcequestion | String | String that specifies a shortcut for the question used as source (used in /overwritewithtable and /overwritewithsql) |
|
/sourcesurveyconnection | String | String used to specify the source QES connection string if the data is in SQL server. (used by /mergeinterviews, /mergequestionnaire, /mergequestionnaireusingid) |
|
/sourcesurveyid | Integer | Value used to specify the id of the source survey if the data is in SQL server. (used by /mergeinterviews, /mergequestionnaire, /mergequestionnaireusingid) |
|
/sourcetype | Integer |
Value used to indicate the type of the source file. (used by /mergeinterviews, /mergequestionnaire, /mergequestionnaireusingid) |
0: QES 1: In SQL Server (Legacy format) 2: Inverted data format 3: Data stored in SQL Server (new SQL format) 4 : Data stored in WebInterviews SQL database |
/sourcewebtable | String |
(used by /type:4, /sourcesurveyconnection, /ImportInNewLevel, /MergeQuestionnaire, /MergeQuestionnaireusingID) |
|
/stackedexport | - |
Flag used to request an export of stacked (level) data. Only works with predefined xml stacked export definition. The following parameters are required: /definitionfile, /datafile. |
|
/storenameinentrycode | - |
Falg used to indicate that Dimensions' user data should be stored as entry codes (used by /importdimensions) [from v.5.6.0] |
|
/systemdk | String | A string to specify which responses (separated by ;) will be set with a Don't Know base type (used by /importpkd, /importdimensions and /importtriples) |
|
/targetquestion | String |
A string indicating the shortcut for the question used as the target. (used in /overwritewithtable and /overwritewithsql) |
|
/unicode | - | Flag used to make sure the data is exported in Unicode | |
/usefactors | - |
Flag use to indicate that values (factors) of scaled responses should be exported. /usefactors:1 [from v.5.6.0] |
|
/uselongcaption | - |
Flag use to make sure long captions will be used in the SAV export /uselongcaption:1 (used by /exportsav) |
|
/targetpassword | String |
Supervisor's user password used to connect the CcaWebAPI when exporting an Askia survey to field. /targetpassword:"password" (used by /exportfield) |
|
/targeturl | String |
CcaWebAPI URL to use when exporting an Askia survey to field. /targetUrl:"https://ServerName/CcaWebAPI" (used by /exportfield) |
|
/targetusername | String |
Supervisor's user name used to connect the CcaWebAPI when exporting an Askia survey to field. /targetUserName:"Supervisor" (used by /exportfield) |
Examples
Import AskiaWeb interview data
To import .DAT files from the command line into a QES file use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /importdat /datafile:"c:\The directory with the .dat"
Import PKD data
To import a .PKD files from the command line into a QES file use the following syntax:
Tools.exe "C:\my directory\My New Qes File.qes" /importpkd /datafile:"c:\my directory\pkdfile.pkd"
Import Dimensions data
To import a Triple-S files from the command line into a QES file use the following syntax:
Tools.exe "d:\qes\res.qes" /importdimensions /datafile:"Provider=mrOleDB.Provider.2;Data Source=mrTripleSDsc;Location=d:\TripleS\P9.asc;Initial Catalog=d:\TripleS\P9.xml;Mode=ReadWrite;MR Init MDSC=mrTripleSDsc;" /pid:201 /"logfile:d:\qes\logfile.txt"
Import SAV data
To import a SAV files from the command line into a QES file use the following syntax:
Tools.exe "C:\my directory\My New Qes File.qes" /importsav /datafile:"C:\my directory\savfile.sav"
To import a SAV files in inverted format from the command line into a QES file use the following syntax:
Tools.exe "C:\my directory\My New Qes File.qes" /importsav /inverted /datafile:"C:\my directory\savfile.sav"
Import Triple S XML data
To import a Triple-S XML files from the command line into a QES file use the following syntax:
Tools.exe "C:\my directory\My New Qes File.qes" /importtriples /datafile:"c:\my directory\triplesfile.sss"
Merge interviews
To merge interviews from the command line from one QES file to another use the following syntax:
Tools.exe "D:\Qes\ex1.qes" /mergeinterviews /"sourcepath:D:\Qes\ex2.qes" /mergetype:1 /delete /completesonly /preserveid /additionalfilter:"EndInterview < now - 14"
Or with SQL data:
Tools.exe "C:\test\qes1.qes" /mergeinterviews /sourcepath:"C:\test\qes2.qes" /sourcesurveyconnection:"Provider=sqloledb; Data Source=XXXXXXX; Initial Catalog=Surveys;Trusted_Connection=no;User Id=XXXXXX;Password=XXXXX" /sourcesurveyid:123 /sourcetype:3 /mergetype:0
Or with webinterviews data :
Tools.exe "C:\test\qes1.qes" /mergeinterviews /sourcepath:"C:\test\qes2.qes" /sourcesurveyconnection:"Provider=sqloledb; Data Source=XXXXXXX; Initial Catalog=WebInterviews;Trusted_Connection=no;User Id=XXXXXX;Password=XXXXX" /sourcewebtable:"MyWebTable" /sourcetype:4 /mergetype:0
Delete interviews
To delete all complete and incomplete interviews from the command line from one QES file to another use the following syntax:
Tools.exe "D:\Qes\ex1.qes" /deleteinterviews /completes /incompletes /additionalfilter:"EndInterview < now - 14"
Or with SQL data
Tools.exe "D:\Qes\ex1.qes" /surveyconnection:"Provider=sqloledb; Data Source=XXXXXXX; Initial Catalog=Surveys;Trusted_Connection=no;User Id=XXXXXX;Password=XXXXX" /surveyid:123 /type:3 /deleteinterviews /completes /incompletes /additionalfilter:"EndInterview < now - 14"
Compact and Repair
To compact and repair your QES file from the command line use the following syntax:
Tools.exe "D:\Qes\ex1.qes" /compact
Transform into loop
To transform a series of questions into a loop from the command line use the following syntax:
Tools.exe "D:\Qes\ex1.qes" /createloop /questions:"qa1_12;qa1_13;qa1_14"
or
Tools.exe "D:\Qes\ex1.qes" /createloop /questions:"qa1_"
Transform into multiple
To transform a series of questions into a multiple closed question from the command line use the following syntax:
Tools.exe "D:\Qes\ex1.qes" /createmultiple /questions:"qa1_12;qa1_13;qa1_14"
or
Tools.exe "D:\Qes\ex1.qes" /createmultiple /questions:"qa1_"
Export the datamap to a text file
To export the datamap from the command line use the following syntax:
Tools.exe "D:\Qes\ex1.qes" /exportdatamap /datafile:"D:\Qes\datamap.txt" /detailed
Import fixed length ascii data
To import .ASC files from the command line into a QES file use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /importfixedlength /datafile:"c:\The directory with the .asc"
Export fixed length ascii data
To export .ASC files from the command line from a QES file use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /Exportfixedlength /datafile:"c:\my directory\File.asc"
Export delimited ascii data
To export .ASC files from the command line from a QES file use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /exportdelimited /completes /sepquestion:; /sepresponse:, /datafile:"c:\my directory\File.asc"
Export in delimited ascii when data are stored in SQL
To export .ASC files from the command line from a QES file with the data stored in SQL use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /exportdelimited /completes /sepquestion:; /sepresponse:, /type:1 /surveyconnection:"Provider=SQLOLEDB.1;Data Source=127.0.0.1;Initial Catalog=Surveys;Persist Security Info=False;UID=XXX;PWD=xxx" /surveyid:xxx /datafile:"c:\folder\data.txt" /logfile:"c:\folder\log.txt"
Export in delimited ascii where data are inverted
To export .ASC files from the command line from a QES file where the data is stored in the inverted files use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /type:2 /exportdelimited /completes /sepquestion:; /sepresponse:, /datafile:"c:\my directory\File.asc"
Export SAV
To export .sav files from the command line from a QES file where the data is stored in the QES files use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /exportsav /completes /datafile:"c:\my directory\File.sav"
Export Triple S
To export .sss files from the command line from a QES file where the data is stored in the QES files use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /exporttriples /generate /completes /datafile:"c:\my directory\File.sss"
Export multimedia files
To export collected multimedia files from the survey, use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /exportmultimedia /completes /datafile:"??shortcut????id??" /directory:"c:\my directory" /questions:"q1;q2"
Merge files using an ID
To export collected multimedia files from the survey, use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /mergequestionnaireusingid /sourcepath:"C:\test\qes2.qes" /sourcetype:3 /sourcesurveyconnection:"Provider=sqloledb; Data Source=XXXXXXX; Initial Catalog=Surveys;Trusted_Connection=no;User Id=XXXXXX;Password=XXXXX" /sourcesurveyid:4 /idquestion:"myID"
Import from Excel / Access
To import Excel files into a QES file use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /importado /datafile:"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\my directory\myfile.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES\"" /query:"SELECT * FROM [Feuil1$]" /maxdiscrete:100 /maxresponse:100 /inverted
Import XML interviews
To import XML interview files (AskiaFace for iOS/Android) into a QES file use the following syntax:
Tools.exe "C:\my directory\My Qes File.qes" /importxmlinterviews /datafile:"C:\Interviews\Here"
Stack Export
To export a QES file of level data use :
Tools.exe "C:\my directory\My Qes File.qes" /stackedexport /datafile:"C:\my directory\My Stacked File.qes" /definitionfile:"C:\my directory\Stacked Export Definition.xml"
Export SAV excluding questions
To export all questions except Q1, Q2 and Q3 use the following syntax :
Tools.exe "C:\my directory\My Qes File.qes" /exportsav /datafile:"C:\my directory\Output.sav /excludequestions:"Q1;Q2;Q3"
Create loops and multiples
Detect & create loops and multiples using regex
The order of the questions does not matter i.e. they do not need to be consecutive in the QES file
Ex1
To create multiples from questions where alphanumeric string before '_' underscore marker is the same and text after is a number to denote response order in the multiple:
Tools.exe "C:\my directory\QesImportedFromSAV" /createmultiple /noyes /regex:"(.+)_[0-9]+"
E.g. this will group . . .
- Questions RB93_1 through to RB93_20 into a multicode 'QRB93' with 20 codes.
- Questions SA1_1 through to SA1_100 into a multicode 'QSA1' with 100 codes.
- . . . and continue to create more multiple questions with any groups of questions that match the pattern specified.
Ex2.
To create loops from questions where variable names end with "SLICE". Immediately before this there is a number to denote iteration order in the loop. Immediately before this there is some alphanumeric string for the variable names.
Tools.exe "C:\my directory\QesImportedFromSAV" /createloop /regex:"(.+)[0-9]+SLICE"
E.g. this will group . . .
- Questions D15B1SLICE through to D15B10SLICE into a 10 iteration loop, 'Loop_D15B1SLICE' with child question, 'QD15B'.
- Questions SA-1SLICE through to SA-50SLICE into a 50 iteration loop, 'Loop_SA-1SLICE' with child question, 'QSA-'.
- . . . and continue to create more looped questions with any groups of questions that match the pattern specified.
Run a verification script
To run a verification script use the following syntax :
Tools.exe "C:\my directory\EX.qes" /runverification /completes /definitionfile:"C:\my directory\MyScript.txt" /logfile:"C:\my directory\Output.txt /reducedsurvey
The ouput file looks like this
Asserts run: 400 Asserts failed: 201 Interviews run: 200 Interviews failed: 151 *** Line 1: 100 failed Interview 2 Interview 3 ... *** Line 2: 101 failed Interview 2 Interview 3 ... The process returns a value that can be read in powershell - it can be one of these
#define TER_NO_DATA_SELECTED -5 #define TER_FILE_EXCEPTION -9 (cannot read source file) #define TER_CANNOT_CREATE_TARGET_FILE -7 #define TER_INVALID_DEFINITION -6 (compilation error in script file) #define TER_CANNOT_OPEN_SOURCE_SURVEY_DB -1 #define TER_CANNOT_READ_SOURCE_INTERVIEW -2
Any positive or zero value: the number of interviews which failed the verification process
Opening a live survey
To export to ASCII delimited a live survey (you no longer need to use the SQL connection strings to access the live data), use the following command line:
Tools.exe /url:"http://ServerName/CcaWebApi" /username:"Supervisor" /password:"pwd" /surveyId:11 /exportdelimited /datafile:"c:\Qes\IhisOut.txt" /completes
Create new data column on-the-fly
Create new data column on-the-fly in delimited ASCII export which can access data from questions or individual responses conditionally by script.
You can add as many columns as you wish using the following syntax.
Tools.exe "C:\MyDirectory\EX.qes" /exportdelimited /completes /sepquestion:; /sepresponse:, /datafile:"C:\MyDirectory\MyExport.txt" questions:^i2_Age^ /addcolumn:"Male:^i1_Gender^ has {1}" /addcolumn:"Female:^i1_Gender^ has {2}"
Export from selected questions
Use the following command line to select open ended and date/time questions to ASCII delimited format:
Tools.exe "C:\Qes\EX.qes" /type:0 /exportdelimited /completes /closedtype:2 /questionselection:"(CurrentQuestion.Type has {\"open\";\"datetime\"} )" /datafile:"C:\Qes\Myexport.txt"
The syntax below selects questions with tags "Demog" + "LifeStyle" and opend ended with anonymised question to Askia survey QES file format
Tools.exe "C:\Qes\Me\ExportData\ex.qes" /export:qes /completes /datafile:"C:\Qes\Me\ExportData\ExportDataRes.qes" /questionselection:"(CurrentQuestion.Tags Has {\"Demog\";\"LifeStyle\"} or CurrentQuestion.Type = \"open\") And (CurrentQuestion.IsAnonymised = False)" /additionalfilter:"i1_Gender = 1"
The same selection can be exported to Askia survey inverted format:
Tools.exe "C:\Qes\Me\ExportData\ex.qes" /exportinverted /completes /datafile:"C:\Qes\Me\ExportData\ExportDataInv.qex" /questionselection:"(CurrentQuestion.Tags Has {\"Demog\";\"LifeStyle\"} or CurrentQuestion.Type = \"open\") And (CurrentQuestion.IsAnonymised = False)" /additionalfilter:"i1_Gender = 1"
And to Askia survey inverted field (SQL) format:
Tools.exe "C:\Qes\Me\ExportData\ex.qes" /exportfield /targetUrl:"http://127.0.0.1/ccawebapi" /targetUserName:"Administrator" /targetPassword:”pwd" /completes /datafile:"NewExport" /questionselection:"(CurrentQuestion.Tags Has {\"Demog\";\"LifeStyle\"} or CurrentQuestion.Type = \"open\") And (CurrentQuestion.IsAnonymised = False)" /additionalfilter:"i1_Gender = 1"
Filter your data exports on string values
In order to filter on strings using the "/additionalfilter:" command, you need to separate the string's double-quotes with a forward-slash: \
Like this:
/additionalfilter:"DUMCity.Value = \"Los Angeles\""
Tools.exe "D:\Exports\ExportFiles\EXAMPLE\EXAMPLE.qes" /exportdelimited /incompletes /completes /type:3 /closedtype:2 /additionalfilter:"DUMCity.Value = \"Los Angeles\"" /surveyconnection:"Provider=sqloledb;Data Source=127.0.0.1;Initial Catalog=Surveys;Trusted_Connection=no;User Id=XXXXX;Password=XXXXXX" /surveyid:XXX /datafile:"D:\Exports\ExportFiles\EXAMPLE\EXAMPLE.txt" /logfile:"D:\Exports\ExportFiles\EXAMPLE\log.txt"
Generate random interviews
Tools.exe "C:\Qes\EX.qes" /generateinterviews /numOfInterviews:1000 /attemptsPerQuestion:10 /SaveIfScreenOut:0
Applying commands to multiple files
To apply the same command to multiple files, one option is to use FORFILES from the command line. For example, to delete all interviews from all QES files in the current directory and sub-directories, use the following:
FORFILES /S /M *.qes /C "cmd /S /C ^0x22C:\Program^ Files^ ^0x28x86^0x29\Askia\Tools.exe^0x22 @PATH /deleteinterviews /completes /incompletes"
Note the use of the ASCII code 0x22 to indicate quotes in the command line path. Similarly, 0x28 and 0x29 are used for opening and closing parentheses. These are necessary because the location of the AskiaTools executable is not added to the PATH variable of the server. The typical location (on an x64 version of Windows) is "C:\Program Files (x86)\Askia". Multiple commands can be included by using an ampersand - & - separator. For example:
FORFILES /S /M *.qes /C "cmd /S /C ECHO @PATH & ^0x22C:\Program^ Files^ ^0x28x86^0x29\Askia\Tools.exe^0x22 @PATH /deleteinterviews /completes /incompletes"
Use of batch files
If you wish to keep a record of the command you use or wish to re-run it we suggest you create a batch (.BAT) file that contains the command(s). You may find the .BAT file easier to read and maintain if you split long command lines across several lines within the file. The general idea is that the ^ character indicates the next line will be a continuation. So, for example, this command . . .
Tools.exe "D:\Qes\ex1.qes" /compact
. . . could appear in a .BAT file across 3 lines like this . . .
Tools.exe ^ "D:\Qes\ex1.qes" ^ /compact
However, if you need to split anything that appears within speech-marks across several lines it is a little more complicated. In that instance you will need a command in your .BAT file to indicate this is the case AND include some additional characters.
So, for example, this command . . .
Tools.exe "xtest.qes" /createmultiple /questions:"ANSWER_1;ANSWER_2;ANSWER_3;ANSWER_4;ANSWER_5"
. . . would require a .BAT file that looked like this . . .
setlocal EnableDelayedExpansion Tools.exe "xtest.qes" ^ /createmultiple ^ /questions:"ANSWER_1;!"=!^ ANSWER_2;^ ANSWER_3;^ ANSWER_4;^ ANSWER_5"
For more information, you may find this article useful.
Return error codes
Add this on a new line after your command has run to capture the error code in the command window:
cmd /k echo Exit Code is %errorlevel%
The process can return the values below. For more information, you may find this article useful.
#define TER_NOERROR 0
#define TER_CANNOT_OPEN_PRIMARY_SURVEY_DB -1
#define TER_CANNOT_READ_PRIMARY_INTERVIEW -2
#define TER_CANNOT_WRITE_INTERVIEW -3
#define TER_UNKOWN_EXCEPTION -4
#define TER_NO_DATA_SELECTED -5
#define TER_INVALID_DEFINITION -6
#define TER_CANNOT_CREATE_TARGET_FILE -7
#define TER_CANNOT_LIST_SOURCE_INTERVIEWS -8
#define TER_FILE_EXCEPTION -9
#define TER_EXECUTION_ERROR -10
#define TER_LOGIN_REFUSED -11
#define TER_SURVEY_NOT_FOUND -12
#define TER_INVALID_SURVEY_FILE -13
#define TER_CANNOT_COMPILE_COLUMN -14
#define TER_INVALID_SURVEY_NAME -15
#define TER_FIELDAPI_ERROR -16
#define TER_CANNOT_READ_MODULE -17
#define TER_CANNOT_COMPILE_MODULE -18
#define TER_CANNOT_RETRIEVE_QUOTA -19
#define TER_UNKNOWN_SCENARIO -20
#define TER_INCORRECT_URL -21
#define TER_CANNOT_CREATE_COM_OBJECT -22
#define TER_CANNOT_CREATE_DOCUMENT -23
#define TER_CANNOT_FIND_SOURCE_QUESTION -24
#define TER_CANNOT_FIND_PRIMARY_QUESTION -25
#define TER_INCOMPATIBLE_QUESTIONS -26
#define TER_CANNOT_OPEN_SOURCE_SURVEY -27
#define TER_CANNOT_OPEN_SOURCE_DB -28
#define TER_CANNOT_READ_SOURCE_INTERVIEW -29
#define TER_CANNOT_READ_PRIMARY_ID -30
#define TER_CANNOT_READ_SOURCE_ID -31
#define TER_CANNOT_READ_SOURCE_FILE -32
#define TER_CANNOT_IMPORT_SEMIOPENS -33
#define TER_CANNOT_PARSE_JSON -34
#define TER_UNKNOWN_QUESTION -35
#define TER_UNKNOWN_ENTRYCODE -36
#define TER_INCORRECT_DATA -37 #define TER_UNKNOWN_QUESTION -101 #define TER_INCOMPATIBLE_QUESTION -102 #define TER_CANNOT_READ_SOURCE_FILE -103