Welcome to the Mythicsoft Q&A site for:

- Agent Ransack
- FileLocator Lite
- FileLocator Pro

Please feel free to ask any questions on these products or even answer other community member questions.

Useful Links:

- Contact Us
- Help Manuals
- Mythicsoft Home
0 votes

I’d like to be able to exclude a range of line numbers from the search. For example, if I have a file that contains the string "My company" in both the file header and in the code, I’d like to not match the string in the file header and only find it in the lines below the header. To do this I’d like to exclude lines 1 -> 11.

asked by (1.6k points)

1 Answer

0 votes

You can do this with the LINES operator. For example,

LINES:10+ (Search AND Term)

Note: The LINES operator was introduced in FileLocator Pro v7. For earlier versions of FileLocator Pro you can achieve the same thing with the Scripting functionality.

Save the script shown below to a text file called ignore_header.js

var nValidFromLineNumber = parseInt( SearchParms.ContainingTextCustomParm, 10 );
function isValidLine( nLineNum, strText ) {
	return nLineNum > nValidFromLineNumber;
}

Activate the script in the Scripting tab and enter the number of initial lines to exclude in the Parm field:

Ignore header scripting

answered by (57.3k points)
...