This page allows you to store the found text (or the text you want to replace the found text with) in an arbitrary file. Such collector function allows to:
If you do not need special expert features, you can use the Single File collector mode.
Follow the steps below to gather text from files and store it in a collector file. This sequence presumes the use of Single File mode.
The tables below describes the tab fields.
General Options
| Field | Description |
|---|---|
| Collect the found text using the following rules | If checked, creates (or reuses) the collector file and stores the text in it. If unchecked, no collecting occurs. |
| Allow collector when performing a scenario | If this options checked, the collector function is allowed if you are performing one of the scenarios. |
Collector file
| Field | Description |
|---|---|
| File to store the collected text |
Path and name of the file to collect the text. If the file and/or path do not exist, they will be created. Path and file format depends on the current splitting mode.
Tags are case-insensitive. This means that <F:n> is equivalent to <f:n> and <M:n> is equivalent to <m:n>.
|
| Browse for file button |
Click this button to locate and select the file to store the collected text. |
| Open file button |
Clicking this button will display a menu with the following commands:
|
| Splitting mode button | Click this button to set the mode of the collector file creation. See Remarks below for detailed description of the collector file modes. |
| Insert tag button |
Click this button to insert a tag of one of the two allowed types: <F:n> or <M:n>. This button is the shortcut to inserting these tags.
|
Existing file mode
Collected text
| Field | Description |
|---|---|
| Found text | If selected, the found text is stored in the collector file. |
| Replacement text (also when searching) | If selected, the text that you've specified in the Replace With field is stored in the collector file. You can store the replacement text even if simply searching files for text. This option is generally useful for searches with Regular Expressions, as it allows you to alter the found text in any aspect. |
Text entry separator
There are three collector file modes, varying in both complexity and capability.
This is the simplest mode. The single file mode stores all the found data in a single file, path and name provided. You can use this mode, for example, to collect any information from your files. For example, you can collect e-mail addresses from multiple pages and store them in a single file.
Example
To store all e-mail addresses form your HTML pages, select the Single File mode, specify path to the collector file (e.g. C:\myweb\emails.csv), type the regular expression in
the Files and Text
tab to describe the e-mail pattern (e.g. [\w\.\_\d]+\@[\w\.\_\d]+\.\w+), set the Collected text option to Found text, Text entry separator to New
line and click Search.
This mode creates a new collector file every time a new found file is started to process. This allows you to separate the found text and distribute it to individual files.
File name creation: "Individual file for each processed file" mode
If you need separate files for each processed file, you would have to define a special rule to form a collector file name and/or path. The HFFR offers you a special tag to define
parts of the collector file name and/or path. The tag has the following format: <F:n>. This tag inserts the contents of the stored expression used in the file filter expression,
numbered by n. To insert the while name of the currently processed file, you can set n to 0.
Example
If you define the following file filter: (get\w+)\.html and specify
the following collector file pattern:
C:\result\file_<F:1>\file.<F:0>.result.txt,
the collector will create a file
C:\result\file_getID\file.getID.html.result.txt
when the HFFR starts to process file getID.html.
This is the most powerful though the most complicated mode. This mode creates a new collector file every time a new occurrence of the matching text is found. This allows you to create individual files for each found text fragment.
File name creation: "Individual file for each match" mode
To define a pattern for collector files, you can use tags <F:n> as with the Individual file for each processed file mode as well as tags <M:n>. This tag
is equivalent to the regular expression operators \n used in replace pattern. This tag inserts the contents of the stored expression
numbered by n. To insert the whole found text in the file path or name, you can set n to 0. You define stored expressions in the Find What field of the Files and Text
tab. Regular expressions option must be turned on to use tags <M:n>.
Example
If you define the following file filter: (\w+)\.cpp and specify
the following search expression in the Files and Text
tab that would match a C++ class method definition:
{[\_\w\d]+}?\s*(C[\w\d]+)\:\:([\_\w\d]+)
and specify the following collector file pattern:
C:\myclassdoc\class<M:1>\<M:1>.<M.2>.<F:1>.txt
the collector will create a file
C:\myclassdoc\classCMyList\CMyList.AddTail.MyList.txt
when the HFFR processes file MyList.html and finds the method CMyList::AddTail.