Command Line for Performing Batch Operations with Text Fields

This type of command line is available in Database Tour Pro.

This topic describes parameters of Database Tour command line, specific to batch operations with data from text fields.

See also more detailed information about operations with data from text fields.

See also common rules for writing command lines.

You can start with this simple example:

dbtour.exe /FieldUtils /CloseWhenDone /CloseOnError /DBInterface=ADO /DBDriver=ACCESS /DB=c:\MyData\Genealogy.mdb /TableName=Client /fields=LastName;FirstName /trim

Here, you open your MS Access database Genealogy.mdb and trim fields LastName and FirstName from Client table. The application closes automatically after execution.

Don't want to hand-write switches? See the next section and build the command line easily from Database Tour GUI.

Or keep reading to know to learn all the switches and parameters.

Building Command Line in a Few Clicks

Usage

Command line options and their descriptions

Examples

Building Command Line in a Few Clicks

Advanced users can build the needed command line manually using the specification below.

But if you are a beginner or need to create a command line or action file without learning the details, use the Database Tour Command Line Builder.

Usage

Classic command line format

The command line consists of all needed switches and parameters:

dbtour.exe /Parameter1 /Parameter2 /... /ParameterN

Short command line format

This format is more flexible as it allows you to keep all command line parameters in a separate action file. The command line consists of the /ActionFile parameter (which points to the action file path) and an optional /silent parameter:

dbtour.exe [/silent] /ActionFile=ActionFileName

Command line options and their descriptions

Main command

/TextUtils

Perform batch operations with text fields. Required parameter for this command line type.

Control parameters

/silent

This switch will run the application in silent mode, without any windows (except purchase reminder when the application is used without registration after the end of the test period). When using /ActionFile option, /silent switch must be outside parameters file. Attention! There are no overwrite or other prompts in this mode.

/ActionFile=Value

Name of the action file, which contains command line parameters, one parameter per line. Lines with a semicolon at the beginning are ignored as comments. Blank lines are allowed. When using this option, there should not be other command line parameters in the command line except /silent switch. If the file name includes spaces, enclose entire parameter in quotes. See example.

Connecting to the database

/UseParadoxPasswords=Value

Semicolon separated list of passwords for Paradox tables (if password protected Paradox tables will be used during the process). Can be used only with /DBInterface=BDE option.

/DB=Value

Name of the database (a database, in which batch operations with text fields must be performed). This can be a file name, folder name, ODBC DSN, BDE alias name, or ADO connection string. If the name includes spaces, enclose entire parameter in quotes. If the name is an ADO connection string with quotes inside, it is recommended to use the short format of the command line.

/DBInterface=Value

Database interface (database engine) used to connect the source database. Possible values: ADO, FD, INTERBASE, BDE. Default value: ADO.

/DBKind=Value

Database kind. Possible values: FOLDER, FILE, DSN, CONSTR; the last one must be used only for ADO interface (see /DBInterface description). If not specified, the application will try to detect it automatically.

Instead of using this parameter, it is possible to use a prefix specifying the database kind (file, folder, ODBC DSN, connection string) in the /DB parameter. The prefix must be enclosed in arrow brackets <>. Possible values: <FILE>, <FOLDER>, <DSN>, <CONSTR>. It is recommended to enclose the entire parameter in quotes in such cases.

/DBDriver=Value

Database driver (or database type). Examples of possible values: ACCESS, DBASE, INTERBASE, FIREBIRD, ORACLE, SQL SERVER, etc. If not specified, the application will try to detect it automatically. If the driver name includes spaces, enclose entire parameter in quotes.

/DBUserName=Value

Database user name. If the user name includes spaces, enclose entire parameter in quotes.

/DBPassword=Value

Database user password. If the password includes spaces, enclose entire parameter in quotes.

/Server=Value

Server address for DB2, SQL Server, Advantage, Informix, Interbase, Firebird, MySQL, PostgreSQL, SQL Anywhere databases. Can be used only with /DBInterface=FD option.

/Port=Value

TCP/IP port on which the DB2, Advantage, PostgreSQL, MySQL, Interbase, or Firebird database server is listening. Can be used only with /DBInterface=FD option.

/Protocol=Value

Protocol used to connect to the DB2, Firebird, or Interbase database server. Can be used only with /DBInterface=FD option.

/OSAuthentication

Use OS authentication instead of database authentication. Can be used only with /DBInterface=FD option.

/AutenticationMode=Value

Authentication mode for Oracle databases. Possible values: Normal, SysDBA, SysOper, etc. Read Oracle documentation for more information. Can be used only with /DBInterface=FD option.

/VendorLibrary=Value

Path to the client library of the database vendor. Can be used only with /DBInterface=FD option.

/VendorHomepath=Value

Path to the client home directory of the database vendor. Can be used only with /DBInterface=FD option.

/SystemDB=Value

Path to the system database file for Access databases. Can be used only with /DBInterface=FD option.

Core text operations

/TableName=Value

Table name, for which text utilities must be performed. If the name includes spaces, enclose entire parameter in quotes.

/trim

Trim leading and trailing spaces and control characters from field data in a table, specified by /TableName parameter.

/capitalize

Convert first character in every word to upper case in field data in a table, specified by /TableName parameter.

/FirstToUpper

Convert first character to upper case in field data in a table, specified by /TableName parameter.

/ToUpper

Convert field data to upper case in a table, specified by /TableName parameter.

/ToLower

Convert field data to lower case in a table, specified by /TableName parameter.

/ReplaceText=Value

Text fragment, which should be replaced in field data in a table, specified by /TableName parameter. Note, that replacement of the text fragments is performed after all other actions, specified in the command line, except adding prefix and suffix. If the text contains spaces, enclose entire parameter in quotes.

/ReplaceWith=Value

Replacement text. If the text contains spaces, enclose entire parameter in quotes. If omitted, then blank string is used (i.e. all text fragments, specified by /ReplaceText parameter, will be replaced with blank strings, or, more simply, will be deleted).

/ReplaceIgnoreCase

Ignore case of symbols when searching the text, which needs to be replaced.

/AddPrefix=Value

Prefix to add to the field data in a table, specified by /TableName parameter. Note, that adding prefix and suffix is performed after all other actions, specified in the command line.

/AddSuffix=Value

Suffix to add to the field data in a table, specified by /TableName parameter. Note, that adding prefix and suffix is performed after all other actions, specified in the command line.

/fields=Value

Names of fields, in which requested operations must be performed. Multiple field names must be separated by semicolon. If the field names contain spaces, enclose entire parameter in quotes. If not specified, all text fields will be processed.

Logging

/LogFile=Value

Name of the file to write operation log. If the name includes spaces, enclose entire parameter in quotes.

/AppendLog

Append new logs to existing log file keeping its previous content. If this switch is omitted, existing log file will be overwritten.

/OpenLog

Open the log file after finishing. Must be used together with /LogFile parameter.

Behavior switches

/CloseWhenDone

Close the application after successful query execution. This option is ignored in silent mode where the application is closed automatically anyway.

/CloseOnError

Close the application when error occurs during the command line execution. This option is ignored in silent mode where the application is closed automatically anyway.

/minimize

Start the application in minimized mode. It is restored to normal mode on error or after ending execution (if /CloseWhenDone switch is not used). This option is ignored in silent mode where the application runs without any windows.

Examples

  • Trimming text fields in dBase table:

    dbtour.exe /FieldUtils /CloseWhenDone /CloseOnError /DBInterface=ADO /DBDriver=dBase /DB=c:\MyDBFFolder /TableName=customer /trim /fields=LastName;FirstName

    This opens c:\MyDBFFolder database (in fact, it is a folder with DBF files) by ADO engine and trims text in fields LastName and FirstName from customer table. The application closes automatically after execution.

  • Replacing text in Access table:

    dbtour.exe /FieldUtils /CloseWhenDone /CloseOnError /DBInterface=ADO /DBDriver=ACCESS /DB=c:\MyData\Genealogy.mdb /TableName=ADDR /fields=Address1 "/ReplaceText=Mark Tweine street," "/ReplaceText=Mark Tweine str.," /ReplaceIgnoreCase

    This opens MS Access database Genealogy.mdb and replaces text in Address1 field from ADDR table. The application closes automatically after execution.

  • The same as the previous one but using an action file:

    dbtour.exe "/ActionFile=C:\DBTourStartParameters.txt"

    The contents of C:\DBTourStartParameters.txt file should be like the following:

    ;action
    /FieldUtils
    ;options
    /fields=Address1
    /ReplaceText=Mark Tweine street,
    /ReplaceWith=Mark Tweine str.,
    /ReplaceIgnoreCase
    ;target definition
    /DBInterface=ADO
    /DBDriver=Access
    /DB=c:\MyData\Genealogy.mdb
    /TableName=ADDR