Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > MIAMEX > MX_TRANSCOPY

TCF Specification

Scroll Prev Top Next More

Added June 2023

The Transcopy Configuration File contains the search and replace patterns and other options to apply to the transcopy operation. The structure is based on standard INI files, with Item=Value elements grouped beneath [Section] headers. Optionally the top section of the file may contain global items (without a [Section] header). The section names are entirely arbitrary, intended for your convenience in grouping related sets of translations within a single TCF file.

The defined item=value pairs (not case sensitive) are:

s{#}=value

Search pattern {optional # in 1-127 range}. Value is a regex pattern. See limitations below.

r{#}=value

Replacement pattern associated with the prior search pattern. If a number is specified, it must match the prior search pattern number. References to submatches in the search pattern must use \# syntax, where the # is the submatch number—not to be confused with the overall search pattern number.

flags=value

Optional REGEX flags. Same as for REGEXxs.

Blank lines, and those beginning with !, ;, or # are treated as comments.

For example, this TCF file...

[cust]

; set PCRE_UNGREEDY...

flags=&h0200

s=([^\w])(orderNo|custName)([^\w])

r=\1wo.\2\3

 

... contains a single section, setting the Regex flags to &0200 (PCRE_UNGREEDY), and defining a single pair of search/replace patterns (with three submatch expressions). This would translate all word-delimited occurrences of "orderNo" to "wo.OrderNo" and "custName" to "wo.custName".

Limitations

Maximum number of s#/r# pairs per section: 127. If you need more, split them into separate sections and execute the operation multiple times, once per section.
If the optional pattern numbers are used, they must be consecutive, and the search and corresponding replacement lines must use the same number. Whether this helps you organize your patterns, or just gets in the way, remains to be seen.
Maximum number of sub-match replacements in a single s# pattern: 99