Biztalk Mapping issue

Home Page Forums BizTalk 2004 – BizTalk 2010 Biztalk Mapping issue

Viewing 1 reply thread
  • Author
    Posts
    • #26221

      Hi All,

      i have a requirement like i need to get the first 30 characters or first line whichever occurs first(if there is a line break)

      could you please let me know the inline C# code to get that in Scripting functiod

       

    • #26225

      What you can do is

      1. Create a flat file schema with a single field with CRLF as delimiter.

      So your second problem is solved…..Getting first row.

      2. Now we need to get max 30 characters from this first row.

      You can use a inline C# functiod with C# code as

      public string Get30Chars(string strFirstRow)

             {

                 if (strFirstRow.Length >= 30)

                     return strFirstRow.Substring(0, 30);

                 else

                     return  strFirstRow.Substring(0, strFirstRow.Length);

             }

      • #26227

        thank you

        • #26228

          i need to get the second 30 characters if there is no line break  and second line when there is a line break

          • #26232

            First use the count functoid to get the count of records.

            If count=1 then get second 30 chars using similar c# code as I sent before ….change the substring index.

            If count>1 then use the index functoid and map the value for index=2. So it will pick the data from second row.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.