Source language: Translate to:

Wildcard in ifex

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Wildcard in ifex

Postby Wrangler » Mon Apr 24, 2006 8:42 am

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.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Gaev » Mon Apr 24, 2006 9:07 am

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" ...
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Wrangler » Tue Apr 25, 2006 7:17 am

Thanks, Gaev! Will give this a whirl today.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest