Database Tour Documentation Contents Index

Command Line Usage: Batch Operations with Text Fields

Top Previous Next

This topic describes parameters of Database Tour command line, specific to batch operations with data from text fields. This type of command line can be used only in Database Tour Pro.

More information about operations with data from text fields can be found here.

Common rules for writing command lines are described here.

Before you start...

Advanced users can build the needed command line manually using the specification below. But if you are a beginner or just need to create a command line for simple operation, you can save your time using Database Tour command line builder. The command line builder interface is very similar to Batch Operations with Text Fields dialog, but it produces a command line string instead of running real operation. To generate a command line, choose 'Tools | Generate Command Line | Batch Operations with Text Fields...' menu. In 'Generate Command Line' window, specify needed options and click OK. A new window will appear with the command line generated. Copy it, correct it if it is needed, and use in Database Tour calls from your own programs, .bat files etc.

Please note that the command line builder cannot generate any type of command line. It produces only generic command lines which is enough for the most of needs and good point to start from. Generated command line can be easily changed manually for more complex tasks.

Usage (specification):

Long (classic) format:
    dbtour.exe [/silent] </TextUtils> [/minimize] [/CloseWhenDone] [/CloseOnError] [/LogFile=LogFileName] [/AppendLog] [/UseParadoxPasswords=ParadoxPasswords] [/trim] [/capitalize] [/FirstToUpper] [/ToUpper] [/ToLower] [/ReplaceText=TextToBeReplaced] [/ReplaceWith=ReplacementText] [/ReplaceIgnoreCase] [/fields=Field1;Field2;...] [/DBInterface=ado|bde|interbase] [/DBKind=DBKind] [/DBDriver=DBDriver] [/DBUserName=UserName] [/DBPassword=Password] [/DB=DBName] [/TableName=TableName]
     
Short format (parameters are excluded from the command line and included in the action file):
    dbtour.exe [/silent] [/ParamsFile=ActionFileName]

If the /TextUtils is used in command line, the program will open a database, specified by /DB parameter, then open a table specified by /TableName parameter, and then will perform operations specified by other parameters, on data from text fields of that table. Log will be written to a file, specified by /LogFile parameter.

Examples:

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

2. 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

3. The same as the previous one but using an action file
dbtour.exe "/ParamsFile=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

Description of the options:

Option Description
/TextUtils Tells the program to perform batch operations with text fields.
/silent This switch will run the program in "silent" mode, without any windows (except purchase reminder when the program is used without registration after the test period). When using /ParamsFile option, /silent switch must be outside parameters file. Attention! There are no overwrite or other prompts in this mode.
/ParamsFile Specifies the 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, entire parameter must be enclosed in quotes. See example 3.
/DB Specifies name of target 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, entire parameter must be enclosed in quotes. If the name is an ADO connection string with quotes inside, it is recommended to use the short format of command line (using the parameters file).
/DBInterface Specifies database interface (database engine) used to connect the target database. Possible values: ADO, BDE, INTERBASE. If not specified, the program will use ADO.
/DBKind Specifies target 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 program 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 Specifies target database driver. Examples of possible values: ACCESS, DBASE, INTERBASE, FIREBIRD, ORACLE, SQL SERVER, etc. If not specified, the program will try to detect it automatically. If the driver name includes spaces, entire parameter must be enclosed in quotes.
/DBUserName Specifies user name for target database. If the user name includes spaces, entire parameter must be enclosed in quotes.
/DBPassword Specifies password for target database. If the password includes spaces, entire parameter must be enclosed in quotes.
/TableName Specifies a table name, for which text utilities must be performed. If the name includes spaces, entire parameter must be enclosed in quotes.
/CloseWhenDone Forces the program to close itself after successful execution. This option is ignored in "silent" mode where the program is closed automatically anyway.
/CloseOnError Forces the program to close itself when error occurs during execution. This option is ignored in "silent" mode where the program is closed automatically anyway.
/minimize Program starts 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 program runs without any windows.
/UseParadoxPasswords Semicolon separated list of passwords for Paradox tables (only for BDE connections).
/LogFile Specifies the name of the file to write operation log. If the name includes spaces, entire parameter must be enclosed in quotes.
/AppendLog Specifies that log of the operations should be written from the end of the log file with saving the previous file content. If this switch is omitted, existing log file will be fully overwritten.
/trim Tells the program to trim leading and trailing spaces and control characters from field data in a table, specified by /TableName parameter.
/capitalize Tells the program to convert first character in every word to upper case in field data in a table, specified by /TableName parameter.
/FirstToUpper Tells the program to convert first character to upper case in field data in a table, specified by /TableName parameter.
/ToUpper Tells the program to convert field data to upper case in a table, specified by /TableName parameter.
/ToLower Tells the program to convert field data to lower case in a table, specified by /TableName parameter.
/ReplaceText Specifies 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. If the text contains spaces, entire parameter must be enclosed in quotes.
/ReplaceWith Specifies replacement text. If the text contains spaces, entire parameter must be enclosed 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 When using this switch, the case of symbols is ignored when searching the text, which needs to be replaced.
/fields Specifies names of fields, in which requested operations must be performed. Multiple field names must be separated by semicolon. If the field names contain spaces, entire parameter must be enclosed in quotes. If not specified, all text fields will be processed.