Find and Replace strings within a TTK or across multiple TTK files from a folder location.

Search options can be set via user profiles and includes the option to use regular expression.

Syntax

Catalyst /FIND TTKName Find:"String to find" [/RAW] [Replace:"String to replace"] [ezLogFile:ezLogFile] [/write] [/open]
Catalyst /FIND TTKName Find:"String to find" [/RAW] [Replace:"String to replace"] [FileName:File_to_Find_Replace] [/A] [ezLogFile:ezLogFile] [/write] [/open]
Catalyst /FIND TTKName Find:"String to find" [/RAW] [Replace:"String to replace"] [FolderName:Folder_to_Find_Replace] [/A] [ezLogFile:ezLogFile] [/write] [/open]

or

Catalyst /FIND FromFolder:FolderName [/S] Find:"String to find" [/RAW] [Replace:"String to replace"] [ezLogFile:ezLogFile] [/write][/open]
Catalyst /FIND FromFolder:FolderName [/S] Find:"String to find" [/RAW] [Replace:"String to replace"] [FileName:File_to_Find_Replace] [/A] [ezLogFile:ezLogFile] [/write][/open]
Catalyst /FIND FromFolder:FolderName [/S] Find:"String to find" [/RAW] [Replace:"String to replace"] [FolderName:Folder_to_Find_Replace] [/A] [ezLogFile:ezLogFile] [/write][/open]

Parameters

/FIND

Find matching content within file/folders specified

TTKName

Tag used to specify the filename of a TTK.

FromFolder

Tag used to specify the path to a folder from which all TTK files should be searched.

/S

Recursive within all sub-folders.

Find:"String to find"

Tag to specify the search string.

Replace:"String to replace"

Tag to specify the replacement string.

ezLogFile:ezLogFile

The user can optionally specify a log file to which results of each Catalyst ezScript command are output.

If the log file is not specified by the user or is invalid, the default log file (ezScriptBatchLog.txt in the Public location) is used.

/RAW

Use the /RAW parameter to enable the option  "Raw Text (including tags and keywords)" in your Find and Replace ezScript command.

By default, the Find & replace option "Raw Text (including tags and keywords)" is not saved to user profiles or remembered when restarting CATALYST. This is to prevent accidental changes to the code in your translatable files. It must be selected when needed.

This option is available for HTML and XML files only.

FileName:File_to_Find_Replace

Name of the file which should be processed for Find/Replace in the TTK file.

 

If the backslash is used, only the filename with the exact path from the root will be processed.


If the exact pathname is not specified by backslash and /A used, then all files with the specified name will be processed.


If the exact pathname is not specified by backslash and
/A NOT used, then only first matching filename will be processed.


FolderName:Folder_to_Find_Replace

Name of the folder which should be processed for Find/Replace from the TTK file.

 

If the backslash is used, only the folder name with the exact path from the root will be processed.


If the exact pathname is not specified and /A used, then all folders with the specified name will be processed.


If the exact pathname is not specified and /A NOT used, then only the first folder with the specified name will be processed.

 

/write

The command line which has been processed by Catalyst will be written into the ezScript batch log file.

This will help to debug your command if something is not behaving as expected.

/open

Launches MS Notepad and displays the content of ezScript batch log when the command finishes.

Notes

  1. The search options are set in the INI file and you must load that specific profile with the settings predefined.
    i.e. Original, Translated, Memo, ID, Match whole word only, Match case, Use regular expression, Ignore hotkey ampersands.

  2. Find on specific Object Types can also be achieved via the user profile e.g. String Tables only.

Examples

Catalyst /C "D:\Profiles\Find_match_case.ini" /load

Catalyst /FIND TTKName:"D:\Working Folder\Alchemy CATALYST 8.0.ttk" Find:"Leverage Expert"

Catalyst /FIND TTKName:"D:\Working Folder\Alchemy CATALYST 8.0.ttk" Find:"Layout Manager"

Catalyst /C "D:\Profiles\Find_match_case.ini" /load

Catalyst /FIND TTKName:"D:\Working Folder\Alchemy CATALYST 8.0.ttk" Find:"Alchemy CATALYST" Replace:"Alchemy Catalyst" ezlogfile:"D:\Working Folder\Find_Replace.log" /write

Catalyst /FIND TTKName:"D:\Working Folder\Alchemy CATALYST 8.0.ttk" Find:"PseudoTranslate" Replace:"Pseudo Translate" ezlogfile:"D:\Working Folder\Find_Replace.log" /write

Catalyst /C "D:\Profiles\Find_regex.ini" /load

Catalyst /FIND TTKName:"D:\Working Folder\FrenchHtml.ttk" Find:"([A-Za-z])" Replace:"\1\\'\2" ezlogfile:"D:\Working Folder\Find_Replace.log" /write