|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 4:16 PM
Points: 215,
Visits: 551
|
|
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.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 11:32 AM
Points: 40,
Visits: 1,531
|
|
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
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 4:16 PM
Points: 215,
Visits: 551
|
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 11:32 AM
Points: 40,
Visits: 1,531
|
|
No Problem, Dude
Expressions are your friend.. 
ArkWare
|
|
|
|