0 votes

I have several million files varing from 500bytes up to 100MB, I know that the information I'm looking for is in the first few bytes of the file. How do I get FileLocator Pro to stop searching the file if nothing is found in the file header?

asked by (1.6k points)

1 Answer

0 votes

Using the LINES operator you can specify to search only the first few lines of a file, e.g.

LINES:1-10 "SearchTerm"

Alternatively if you want it to only apply to certain file types there's an undocumented interpreter that only reads lines until a total of 50 characters is read. To activate the interpreter for a given file type you need to add a config file to the plugin_cfg folder. Save the following text in a file called header.xml:

<?xml version="1.0"?>
<InterpreterConfig xmlns="http://www.mythicsoft.com/FileLocator">
	<displayname>Text Header</displayname>
	<uniquename>http://www.mythicsoft.com/fileheaderonlyreader</uniquename>
	<progid>Extensions.FileHeaderOnlyReader</progid>
	<filetypes>txt</filetypes>
	<interpretertype>textinterpreter</interpretertype>
	<active>no</active>
	<safemode>no</safemode>
	<useisfilter>no</useisfilter>
	<nonreglibrary>extensions.dll</nonreglibrary>
</InterpreterConfig>

If you then open FileLocator Pro and go to Configuration->Extensions you should see a new extension called Text Header. Change the file types to the ones you're interested in restricting (it defaults to txt) and then make sure it's switched on in the Office/PDF Documents settings in the Options tab.

When FileLocator Pro now searches the specified file types only the lines up to the first 50 bytes of the file will be read.

answered by (66.9k points)
...