SSIS Expression to Find Text Between Characters

Posted by Compudicted on Geeks with Blogs See other posts from Geeks with Blogs or by Compudicted
Published on Mon, 31 Jan 2011 17:14:23 GMT Indexed on 2011/01/31 23:26 UTC
Read the original article Hit count: 265

Filed under:

It will be a super short and looks like the first and last post in January 2011.

So back to the topic, I decided to share an SSIS expression I crafted to extract the value concealed between two characters (I needed to get a portion of text in a file path):

Substring(@[User::MyString],FINDSTRING(@[User::MyString],"(",1)+1,FINDSTRING(@[User::MyString],")",1) - FINDSTRING(@[User::MyString],"(",1)-1)

The value of MyString say could be c:\test\test(testing123456789).txt, then the resulting text captured testing123456789.

Hopefully it will be needed to somebody.

© Geeks with Blogs or respective owner