January 16, 2009 at 4:42 pm
Hi
I am using a Foreach loop container and in the derived column im trying to retrieve only the Filename but when I use the variable which actualy stores the Filename I also get the path of the File For example If a use a variable in the derived column expression I get the following Output C:\Data\Loop\Filesame.xls but I only need the file name i.e., name... How do i do that .. I have tried using Name only option in the For each Enumerator but it gives me error asking me to check if the Worksheet Name [Excel Source [122]] Error: Opening a rowset for "New$" failed. Check that the object exists in the database.
January 20, 2009 at 7:15 am
Hey Danny,
one way to get the file name only would be to create another variable. set it's property, EvaluateAsExpression to True. Then enter the following expression:
REVERSE(SUBSTRING( REVERSE(@[User::filename]),1, FINDSTRING( REVERSE(@[User::filename]) , "\\", 1 ) -1))
replace the @[User::filename] variable in the sample code with your variable that is being populated by the ForEachFile loop.
ArkWare
January 20, 2009 at 12:47 pm
Thanks a lot dude!!!!
January 20, 2009 at 1:09 pm
No Problem, Dude
Expressions are your friend.. 😎
ArkWare
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply