Page 1 of 1

Wildcard in ifex

PostPosted: Mon Apr 24, 2006 8:42 am
by Wrangler
Using ifex, I'm checking for certain files in a folder that I don't want to copy, like this:

IfEx "[Name[X]] <> go.php and [Name[X]] <> index.php"

This works great. But some of the files have varying filenames, such as index-2.php, index-3.php, up to maybe index-50.php. Is there a way of using a wildcard in ifex so I don't have to repeat [Name[X]] <> 50 times?

IfEx "[Name[X]] <> go.php and [Name[X]] <> index.php and [Name[X]] <> index-2.php and [Name[X]] <> index-3.php" etc.

PostPosted: Mon Apr 24, 2006 9:07 am
by Gaev
Wrangler:
Is there a way of using a wildcard in ifex so I don't have to repeat [Name[X]] <> 50 times?
a) Split Name[x] into the file and extension parts i.e. StrParse [Name[x]] with delimiter of "." to give something like [NamePart1] and [NamePart2] **

b) SubStr the first part (NamePart1]) so you extract the first five characters (like "index") into a variable (like [FiveAmigos])

c) IfEx "[FiveAmigos] = index and [NamePart2] = php" ...


** in case files have more than one dot (.) in their name e.g. John.Smith.php, you should use the "count variable" from the StrParse command to make sure you are always comparing against the last parsed element e.g.

IfEx "[FiveAmigos] = index and [NamePart[NameSplitCount]] = php" ...

PostPosted: Tue Apr 25, 2006 7:17 am
by Wrangler
Thanks, Gaev! Will give this a whirl today.