TextSearch plugin

Contents

Introduction

This Total Commander Content plugin allows to perform full-text search in any documents, which have command-line converters to the plain-text form.

To use this plugin, call Total Commander's search dialog (Alt+F7) and activate plugin on Plugins tab, as shown on picture:

Converters

Included converters are:

Other useful converters are:

Configuration file

Plugin configuration file is TextSearch.ini, located in the plugin folder. If it doesn't exist, TextSearch.Sample.ini is copied to TextSearch.ini on execution.

[Options] section

Plugin options are listed here:

Options Meaning
Log If set to 1, then TextSearch.log file will be created in the %TEMP% folder, containing error messages about converters execution.
ShowErrors If set to 0, no error messages will be displayed. To see errors occured you still can use the Log option.
DeleteOutFile If set to 0, resulting file (from {Out} macro) won't be deleted.

[Converters] section

Converters for different file extensions are listed here in the form
EXTENSION=Path\Converter.exe Parameters
or
EXTENSION=ANOTHER_EXTENSION
Converter path can be written without plugin folder path (plugin folder set as current on converter execution).
Parameters can contain the following macros/commands, at last "{In}" and "{Out}" macros should be specified:

Macros Meaning
{In} Expanded to full path of the source file.
Should be double-quoted.
{Out} Expanded to full path of the resulting temporary text file.
Should be double-quoted.
{InShort} Expanded to short (8.3) path of the source file.
{OutShort} Expanded to short (8.3) path of the resulting file.
Commands Meaning
{CP:Codepage} Specifies that resulting file should be decoded from some "codepage" to the ANSI. Allowed values of Codepage are (self-descriptioned):
  • ANSI (has meaning only when multiple codepages are specified)
  • UTF8
  • UTF16 (BE or LE are detected automatically by first 2 bytes)
  • UTF16BE
  • UTF16LE
  • RTF (Note: RTF assumed to be in ANSI codepage)
{Home:Path} Specifies the "home directory" of the converter process, Path value. Can be set e.g. to the converter application path if converter doesn't support running from non-application folder.

Direct codepage conversion

It is possible to read the source file directly and to apply a "codepage conversion" to it, without running any external converters at all. To do so, specify only {CP:Codepage} command for a file extension, for example:
[Converters]
RTF={CP:RTF}
LOG={CP:UTF8}

Multiple codepages search

It is possible to perform Total Commander search applying several codepages to a file at the same time. This isn't possible in Total Commander without using TextSearch plugin (currently): TC doesn't allow to check several codepages flags on its 1st tab of search dialog. When multiple codepages search is performed with TextSearch plugin, plugin converts given file to multiple codepages and then concatenates the resulting strings to a single big string, giving this big string to Total Commander. So such search is more slow, approx-ly by 10-50%.

To perform multiple codepages search, write several {CP:Codepage} commands to the corresponding converter line, for example:

[Converters]
LOG={CP:ANSI} {CP:UTF16}
To perform multiple codepages search in all files specify the "*" extension, for example:
[Converters]
*={CP:ANSI} {CP:UTF8} {CP:UTF16}
Note that the "*" converter has the lower priority, so if for example both "*" and "PDF" converters are specified, all PDF files will be searched using "PDF" converter and other files will be searched using "*" converter.

Copyrights