Skip to content

Variable get filename without extension

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
  • prokopis Offline
  • Posts: 4
  • Joined: Tue Jun 02, 2015 6:08 am

Variable get filename without extension

Post 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
  • Support_Rick Offline
  • Support Specialist
  • Posts: 590
  • Joined: Tue Jul 17, 2012 2:12 pm
  • Location: Phoenix, AZ
  • Contact:

Re: Variable get filename without extension

Post 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
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Post Reply