Retrieving Partial File name from the Full path in an Orchestration

Asked By Abhishek Iyer
30-Aug-10 06:09 AM
Earn up to 0 extra points for answering this tough question.
I need to update a table in Sql server where the file name in the column would be something like "abc.xml". But how to get this in the orchestration as the (FILE.ReceivedFileName) property procures the entire name viz. "C:\Abc\Def\abc.xml"? So, it requires that the entire name be used in the database, which is not to be in my case.

  re: Retrieving Partial File name from the Full path in an Orchestration

Mohan Raj Aryal replied to Abhishek Iyer
30-Aug-10 02:07 PM
Once you read the absolute file name with path you can read the name of the file only using some string manipulation function inside expression shape. You can use expression something like: 

myFileName =FILE.ReceivedFileName.Substring(FILE.ReceivedFileName.LastIndexOf("\")+1, FILE.ReceivedFileName.Length);

In this case myFileName is a orchestration string variable. Once you have filename in a variable you can assign this to your destination field using xpath or distinguished field. Once you populate this to the destination schema field of database you can insert this to the SQL server.
Create New Account
substring and LastIndexof combination Example: Dim themes as string = Directory.getDirectories(server.mapPath each theme as string in themes dropdownlist1.Items.Add(themes.substring(theme.LastIndexOf(" \ "+1)) Next Try this simple way void getThemes() { string [] themes each theme as string in themes dropdownlist1.Items.Add( theme .substring(theme.LastIndexOf(" \ "+1)) Thank you. Create New Account keywords: substring, and, LastIndexof, combination description: Example: Dim themes as string = Directory.getDirectories(server
biztalk I have a receive port and send port. the received
BizTalk-Port Binding Properties not list binding Right click and Select
substring " Select * from tblPA where SerialNo LIKE '(@txtSearchSerialNo)%'" ; I want the
Substring in the query " Select * from tblPA where SerialNo LIKE '(@txtSearchSerialNo
Biztalk Sequential convoy Problem Hi, my scenario is: i have 4
BizTalk Weird Mapping prob Hi, I'm mapping a HL7 schema
biztalk Map I am mapping for outbound 810 and have to