About CPL Scripts

<< Click to Display Table of Contents >>

Navigation:  Concordance Programming Language Reference > Concordance Scripts >

About CPL Scripts

The Concordance scripts listed below are delivered with Concordance. The customer support team can help resolve issues or answer questions regarding these scripts. For more information about editing and running CPL scripts, see Creating and Editing a Concordance Script and Running a Concordance Application.

If you do not have access to the CPLs in the Concordance install directory, the CPLs are available for download here:

Concordance version 8.x

Concordance version 9.x

Concordance version 10.x

 

CPL Name

Description

Usage

AppendOneFieldToAnother_v10.00

Uses a field based on options the user selects and appends, prepends, or copies data from one field to another.

Append: Copying one field to the end of another.

Global variables are capitalized in this program. Local variables are in lower or mixed case.

Variable names in all upper case, i.e., LEFT, are initialized once and should not be changed afterwards.

AppendTextToField_v10.00

Appends or prepends data to a field, leaving existing data intact.

Global variables are capitalized in this program. Local variables are in lower or mixed case.

Variable names in all upper case, i.e., LEFT, are initialized once and should not be changed afterwards.

BlankField_v10.00

Erases data from a user-specified field.

To start, edit the FIELDNAME entry to represent the name of the field that you want to blank out. The FIELDNAME needs to be entered exactly as it displays in the database. The field specified should be a Text or a Paragraph field. Once this is done, you will need to save the CPL and launch it from within Concordance.

Note: Running this on a Numeric or a Date field will not blank the field. Date fields will continue to hold a date of 00/00/0000 and Numeric fields will simply display 0.

BulkConvertImagesbases_v10.00

Converts all imagebases to the selected version in the directory you specify.

This program can bulk convert imagebases to version 5.

Imagebase versions will be recorded in whole numbers and not decimals.

For example, imagebase versions 3 and 4 will display as 3 or 4, but not 3.x or 4.x.

Once you select a directory, the program will convert all imagebases to the selected version in the directory you specify and all its subdirectories.

ConvertTextToDate_v10.00

Converts dates in a text field to a valid date in a date field. Preserves invalid dates, like 12/00/92 or 00/00/00. All dates are assumed to be in MM/DD/YY format.

 

CreateHyperlinks_v10.00

Cycles through the current query of an e-mail database and creates hyperlinks from the file paths listed in the ATTACHMENT field.

Does not need user modifications to run properly.

EDocView_v10.00.cpl

Uses the Concordance View Image button to launch the native document in its native application from within an e-document database.

This CPL looks for a field named "FILEPATH", so if you renamed the field to e.g., "ATTACHMENT", then the CPL will need to be edited to replace all instances of "FILEPATH" with "ATTACHMENT."

Note: This CPL cannot be used on a database with an existing imagebase of TIFF images.

 

FieldToTag_v10.00

Copies the contents in a field to a tag, as identified by the user.

There is a line in the CPL that defines "pszField". As delivered, this CPL assigns the value "MYFIELD" to pszField. Then the CPL creates a tag with the same name as the contents of MYFIELD.

To use this CPL, alter "MYFIELD" to the field name that contains the tagging information you want to convert and run the CPL.

FindAttachements_v10.00

Uses an attachment range field to find attachments for the current query as opposed to the current document.

Note: Attach.cpl and Attach2.cpl have been replaced by FindAttachments.cpl and FindAttachments2.cpl and are not installed in Concordance version 9.52 and higher.

There is a line in the CPL that defines "ATTACHFIELD" and "ATTACHTAG". As delivered, this CPL assigns the value "ATTACHMENT" to ATTACHFIELD and "Attachments" to ATTACHTAG. For each document in the query, this CPL then tags each document that has an "ATTACHMENT" field and tags it with "Attachments".

This CPL runs a series of relational searches (equal to the number of records in the current query), using the information contained in the user defined "ATTACHFIELD", across the contents of the entire database. A temporary tag is created by the CPL with a user defined name taken from the "ATTACHTAG" entry. At the completion of this CPL the results are displayed in the new current query and the temporary tag is removed.

The user needs to change the "ATTACHMENT" entry in the CPL to reflect the name of the field that holds the attachment range.

FindAttachements2_v10.00

Uses a beginning and an ending attach field to bring together attachment ranges from the current query as opposed to the current document.

 

IssueToTag_v10.00

Converts all issues from the current query into tags.

Should not need modification. It prompts the user for the information it needs using message boxes. After the information is collected, this program performs the conversion on the current search list.

LoadOCRFromOpticonLog_v10.00

Used when you have single-page OCR .txt files in the same directory as the .tif files. With the Concordance Image log file pointing to the images, the OCR text files can be loaded into the database. The CPL prompts for the log file and the field to contain the OCR text.

This script automatically overflows to the next field if the first field's content exceeds 12MB and you have sequentially numbered the OCR fields.

This CPL requires that the following directory exist on the machine running the script: C:\temp\convert.

A log file named ocrdcb.txt is written to the "convert" folder as the script finishes.

Mark_v10.00.cpl

Considered a sub-program by other CPL scripts, like Spell.cpl. This script allows users to select fields from the currently opened database for subsequent action by the main program. Use Mark.cpl if you encounter the message prompt, Couldn't find Mark.cpl when running another program.

Note: You will need to update Mark.cpl with the version number appended to the CPL name. For example, for version 10.00, change Mark.cpl to Mark_v10.00.cpl.

There is nothing the user needs to change in this program to get it to perform. Menus will guide the user through all aspects of this program's functionality.

PDFPrint_v10.00.cpl

Automatically prints the current query of a Concordance E-documents database using an Adobe Acrobat viewer, such as Adobe Reader, as the print application. This utility is part of the Concordance E-Documents template, and is launched from the Adobe print menu item.

 

PrintWithAttachments_v10.00

Prints documents and their attachments. This script uses the command shellExecute() to prompt the operating system to use the program associated with the file type. If a program is not associated with the file type, then it will not print the document. Errors are logged to a file called Print-With-Attachments Error.log.

You must create and save a print format file to the same directory as this program. Call the print format file: Print-With-Attachments.fmt. It is used to specify the print formatting options.

READOCR1 (singlePage)_v10.00

Cycles through the current query and locates the image field, then translates the image into a filename for the corresponding OCR text. This script reads the file and writes content into the specified paragraph field.

Does not need user modifications to run properly.

This revision is for databases that contain the full path, file name, and extension for the OCR.txt files.

readOCR1_v10.00

Cycles through the current query and locates the image field, then translates the image into a filename for the corresponding OCR text. This script reads the file and writes content into the specified paragraph field.

Does not need to be modified to run properly.

readocr_v10.00

Cycles through the current query and locates the image field, then translates the image into a filename for the corresponding OCR text. This script reads the file and writes content into the specified paragraph field.

Does not need to be modified to run properly.

ReindexingDaemon_v10.00

Reindexes all databases that have the file path location written into a log file.

There are several lines in the CPL that define szUserID, szPassword, and LogFile. Put your user id, password, and the log file name between the quotation marks in the proper variables. Then run the program.

Renumber_v10.00

Assumes that a search has already been performed to isolate documents that need to be numbered. This script prompts for a field name, a starting numeric value, a range, and an optional alphabetic prefix. It assigns values to the database field for every document in the current query.

Example: ABC00005 through ABC0949

Does not need to be modified to run properly.

ShowSystemFields_v10.00

Displays system fields.

Does not need user modifications to run properly.

Spell_v10.00

Scans documents and prompts the user to correct misspelled words.

Creates a file to store skipped words. The file name is created by combining the database path/name with the file extension: .SPL. The file is stored in the same directory as the database.

Does not need modification to run properly. Can run from Concordance, or called with the Run() function by passing Spell() the database handle.

Synonym_v10.00.CPL

Loads a text file containing synonyms into a Concordance .syn B-tree file for Search mode.

1.A blank line separates one synonym group from another.

2.Words in a group (not preceded by anything) are stored as synonyms.

3.Words preceded by a minus sign are sub-categories of the main word.

4.Words preceded by a plus sign are stored as synonyms AND have their own sub-groups.

Examples:

Words preceded by a "-" are stored as related terms but are not stored as synonyms. In the following example the word "colors" would pull up red, green, and blue. But searching for red would only search for red.

colors

-red

-green

-blue

This allows you to create additional synonym groups as subcategories. Use the "+" sign if a word in a synonym group has its own group.

colors

+red

-green

-blue

red

reddish

-ochre

-brick

Now red has its own group and its own set of narrower terms. In this case searching for colors would pull up red, which in turn would pull up the red group. Searching red or reddish would pull up ochre and brick as well. However, searching for ochre, brick, green, or blue would not pull up any additional synonyms.

The synonyms are not limited to single word entries, they can contain any query logic that can be entered in the Search task pane. This includes parenthetical logic, search operators, and even fixed field searches. Note that synonyms on different lines are OR'ed together during the search processing.

Does not need modifications to run properly.

TagHistoryAndStoreIt_v10.00

Writes the tag history held in the .trk file to a paragraph field in the database named TAGINFO.

 

TAGSAVER_v10.00

Writes the current list of tags from the database into a .gat file. The .gat file can be stored for future use, in case tags are lost due to corruption or user error.

When prompted to select a field, please be sure to select one that contains unique values in your database, as this is the linking field that associates each record with its tags.

For example, in the CALFCO database, this field would be "STARTPAGE", but in other databases you might need to select e.g., "BEGDOC".

Does not need modifications to run properly.

Note: If the database is new and has never been indexed, index the database before running the TAGSAVER CPL.

TagToField_v10.00

Copies the a tag name to a field, as identified by the user.

Before launching the CPL, create or designate a database field to hold the tag information.

When the CPL is started, the user is prompted for the following information.

1.Open database: Database name

2.Tag field: Field designated to hold the tags

3.Delimiter: Character used to separate the tags

After this information is entered, the user selects Go to run the CPL.

TextFileToQuery_v10.00

Reads an ASCII text file and runs a query on each line of the file. Each line can be written for a full-text or relational search. When the process is completed, the text file results are concatenated into a single query. There is no known limit to the number of lines that can be run from the text file.

There is a line in the CPL  that defines "ATTACHTAG". As delivered, this CPL assigns the value "Attachments" to ATTACHTAG. Then the CPL tags the new query results from the ASCII file with the contents of ATTACHTAG.

UpperCase_v10.00

Converts text to upper case.

Note: Running UpperCase_v10.00.cpl changes all field text to the default font settings. For example, if the default font is Arial 9 and the field text is Times New Roman 12 bold, running UpperCase_v10.00.cpl changes the field text to upper case and also changes the font to Arial 9 regular.

Does not need modifications to run properly.