Page 1 of 1

Variable get filename without extension

Posted: Fri Jul 03, 2015 11:42 am
by prokopis
hi

i have set to a variable certain value(ex. abcd1.txt) using SetVariable task. Now from this variable how can i get the name (abcd1) without the extension?
thanks

Re: Variable get filename without extension

Posted: Mon Jul 06, 2015 6:30 pm
by Support_Rick
Example:

<setVariable label="SetVar: MyFile" name="MyFile" value="C:\Temp\ABC123.txt" version="2.0" />

<setVariable label="SetVar: FileWOExt" name="FileWOExt" value="${ FileInfo( MyFile ):nameWithoutExtension }" version="2.0" />


PRINT:

${ FileWOExt } = ABC123