Strip the file name out of the file path

Strip the file's name out of the file path:

Example: [User::strTest] Value = C:\Test\TestTextFile.TXT
Results: TestTextFile.TXT

RIGHT(@[User::strTest],FINDSTRING(REVERSE(@[User::strTest]),"\\",1)-1)



Strip the file's extension out of the file path:

Example: [User::strTest] Value = C:\Test\TestTextFile.TXT
Results: TXT

RIGHT(@[User::strTest],FINDSTRING(REVERSE(@[User::strTest]),".",1)-1)

Comments

Popular posts from this blog

Run a VBscript using SQL Server.

Practical Web Scraping with Python: A Clean, Safe Pattern for Pulling Company Names & Emails

SSIS to Sybase OLEDB connection error [IM002]. [Native Code: 30136]