Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SSIS Expression FileName

Posted on 2014-03-03
2
Medium Priority
?
338 Views
Last Modified: 2014-11-21
I’ve created a variable called strFileName as below with the following expression

substring(@[User::strFileName], 1, FINDSTRING(@[User::strFileName], "Test", 1)-2)
####_#########_#######_###_######_Test_18-1-2014.csv

Which works fine and returns the file name but the problem is the file name changes tomorrow it could be

####_#########_#######_###_######_Test_19-1-2014.csv or
####_#########_#######_###_######_Test_18-10-2014.csv

So what I need to do is extract the last part of the filename and add it to my expression.
If I get the total length of the filename, then from the left get the first 34 characters.
0
Comment
Question by:aneilg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
fibo earned 1155 total points
ID: 39902478
- You have the filename in string
- You want to extract the part that starts at the 35th character (position 34 if starting at 0)

Is that correct?

If so, then I presume that
substring(@[User::strFileName], 35,length(@[User::strFileName]))
should do the trick (note that "extracting more characters" than there are in the string is OK and will return gracefully the expected result)
0
 

Author Comment

by:aneilg
ID: 39925768
thanks. i'll give it a go.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question