'num.vbs 'Script for Script Content Plugin '(c)Lev Freidin, 2005 'http://www.totalcmd.net/plugring/script_wdx.html 'http://wincmd.ru/plugring/script_wdx.html ' by Rodny 'To search for numeric ranges in the file names: 'file1.0001.txt, file1.0002.txt, ..., file1.9999.txt, 'file2.0001.txt, file2.0002.txt, ..., file2.9999.txt, ... 'Find all file1.X.txt, file2.X.txt,..., where X are from x1 to x2 Dim x1, x2, Res Set re=new regexp '%%%%%%%%%%%%%% Editable settings x1=5 x2=153 '%%%%%%%%%%%%%% /Editable settings re.Pattern="(.+\.)(\d{4})(\.[^\.]+)$" Res = CInt(re.Replace(filename,"$2")) If (Res>=x1) and (Res=<x2) Then content = "1" Else content = "0" |