Displayed fields are:
- Line - content of the line specified in INI file,
- Contains - boolean value showing does directory contains the file,
- RegExpResult - regular expression result (see below).
Usage
Install this plugin and copy "wdxcontains.ini" file into TC's directory.
Options description:wdxcontains.ini wrote:[Options]
FileName=readme.txt
LineNumber=1
UseRegEx=false
Expression=(\d{2}[.]\d{2}[.]\d{2})[ ]
- FileName - name of the file to be looked for (default: readme.txt);
- LineNumber - number of the line to be read and returned for "Line" field (default: 1);
- UseRegEx - boolean value telling should plugin use regular expressions for finding text string inside file; all lines are checked; first match returns value for "RegExpResult" field;
- Expression - regular expression to be checked;
Note, that by default plugin looks for brackets in expression and tries to return $1. In the case of no brackets whole expression is given.
Example 1
readme.txt wrote:this is sparta
sialala 12.35.44 bumcykcyk
date: 12.11.07
komibnerki sialala
wdxcontains.ini wrote:[Options]
FileName=readme.txt
LineNumber=1
UseRegEx=true
Expression=date: (\d{2}[.]\d{2}[.]\d{2})
Example 2Results wrote:Line=this is sparta
Contains=Yes
RegExpResult=12.11.07
readme.txt wrote:this is sparta
sialala 12.35.44 bumcykcyk
date: 12.11.07
komibnerki sialala
wdxcontains.ini wrote:[Options]
FileName=readme.txt
LineNumber=4
UseRegEx=true
Expression=date: \d{2}[.]\d{2}[.]\d{2}
You can give a try and download this here:Results wrote:Line=komibnerki sialala
Contains=Yes
RegExpResult=date: 12.11.07
http://cid-e12762cbdafb3c47.skydrive.live.com/self.aspx/TC/WDXcontains7.zip
Edit: 9th of September, 2008
Two new fields are available now:
- FilesRegExpResult - file's name regular expression result,
- ContainsFile - boolean value which informs does a folder contain searched file.
They can be configured using additional "wdxcontains.ini" parameters:
- ParseFileNames - should plugin parse folder's files names list (default: false),
- ParseWithDirs - include folders names (default: true),
- IncludeHidden - include hidden resources (default: false),
- FileNamesExpression - file's name expression to be looked for (default: "").
FileNamesExpression is handled the same way as Expression: plugin looks for brackets in expression and tries to return $1. In the case of no brackets whole expression is given.
Note
If "ParseFileNames" is set to true, plugin will create "wdxcontains" folder in %TEMP% path with "list.txt" file inside. This file contains all file names from searched folder. Mentioned temporary dir should be deleted automatically after returning needed value.
Special thanks to:
- chrizoo - for help with testing,
- m^2 - for help with VirtualQuery(),
- icfu - for reminding about INF.