|
Find and Replace |
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.
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]
/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.
|
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.
|
/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. |
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.
Find on specific Object Types can also be achieved via the user profile e.g. String Tables only.
This example loads the User Profile D:\Profiles\Find_match_case.ini. Now working on the TTK, Alchemy CATALYST 8.0.ttk we look for the strings "Leverage Expert" and "Layout Manager". The match case results of these search commands will default to the standard log ezScriptBatchLog.txt in the Public location.
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"
This example loads the User Profile D:\Profiles\Find_match_case.ini. Now working on the TTK, Alchemy CATALYST 8.0.ttk we look for a string and provide a replacement string. Only strings which match case will be found and replaced. The outcome of these batch commands will be saved to the log file D:\Working Folder\Find_Replace.log. The /write switch will also output the command as read by Catalyst into the log file before executing the command.
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
This example loads the User Profile D:\Profiles\Find_regex.ini so that we use a regular expression search. The search itself will find all single quotes between alpha characters and escape them with a backslash
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