Topic Options
#39463 - 05/03/12 04:42 PM file name comparison
Alain B Offline
OL Guru

Registered: 09/30/08
Posts: 101
Loc: Montreal
Hi we have a condition on the file name, we currently look for file who match the extension .CSV

is there a way to compare upcase value so if the file name is .Csv , .csv or .cSV if recognised has .CSV

I know that if we use is found or is not found there is an option who say compare to upcase before comparison but this is for data inside the file what we want to compare is the file name.

Top
#39467 - 05/04/12 09:46 AM Re: file name comparison [Re: Alain B]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1931
Loc: Objectif Lune, Montreal, Qc
After you capture the file, add a Mathematical expression task to convert the name to upper case (yes, this task can be used for non-math related expressions as well!). In the properties of that task, set the expression to ucase("%o") and store the results in %9. Then, use a standard condition (instead of a filename condition) to check the contents of %9.

Alternatively, add a script as a condition immediately after ytou capture the file so you can achieve the same thing in a single task. The script would simply contain the following line:


Script.returnvalue = instr(ucase(Watch.ExpandString("%o")),".CSV")>0



Hope that helps,
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#39468 - 05/04/12 10:03 AM Re: file name comparison [Re: Philippe F.]
Alain B Offline
OL Guru

Registered: 09/30/08
Posts: 101
Loc: Montreal
Thanks, I will try the mathematical expression

Top