August 16, 2010 at 7:35 am
All,
I have string
<UL style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light">
<LI style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light">The Fund_ s performance information contained in this summary relates to the Interest Class identified above. The Fund generally offers three Classes of Interests, each of which is subject to a different fee structure. Summary information regarding the Fund_ s other Interest Classes is available upon request.
<LI style="FONT-SIZE: 8pt; FONT-FAMILY: Frutiger LT 45 Light">
<LI style="FONT-SIZE: 10pt; FONT-FAMILY: Frutiger LT 45 Light">Past performance is not indicative of future results. There can be no assurance that the Fund_ s performance will be comparable in the future to what it, or the performance of the Underlying Fund, has been in the past.
<LI style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light"><B style="mso-bidi-font-weight: normal"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light" Frutiger LT 47 LightCn?; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: ?MS Mincho?; mso-fareast-language: JA; mso-bidi-font-family: ?Times New Roman?; mso-ansi-language: EN-US; mso-bidi-language: AR-SA?>Please refer to _ General Disclosures and Performance Notes_ at the end of this document for more detailed explanations of the information contained herein and a summary of certain risks, in addition to the Offering Materials.</SPAN></I></B>
</LI>
</UL>
Now, I want this string to look like below,
<UL style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light">
<LI style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light">•The Fund_ s performance information contained in this summary relates to the Interest Class identified above. The Fund generally offers three Classes of Interests, each of which is subject to a different fee structure. Summary information regarding the Fund_ s other Interest Classes is available upon request.
<LI style="FONT-SIZE: 8pt; FONT-FAMILY: Frutiger LT 45 Light">•
<LI style="FONT-SIZE: 10pt; FONT-FAMILY: Frutiger LT 45 Light">•Past performance is not indicative of future results. There can be no assurance that the Fund_ s performance will be comparable in the future to what it, or the performance of the Underlying Fund, has been in the past.
<LI style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light">•<B style="mso-bidi-font-weight: normal"><I style="mso-bidi-font-style: normal"><SPAN style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light" Frutiger LT 47 LightCn?; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: ?MS Mincho?; mso-fareast-language: JA; mso-bidi-font-family: ?Times New Roman?; mso-ansi-language: EN-US; mso-bidi-language: AR-SA?>Please refer to _ General Disclosures and Performance Notes_ at the end of this document for more detailed explanations of the information contained herein and a summary of certain risks, in addition to the Offering Materials.</SPAN></I></B>
</LI>
</UL>
Basically,
I want (•) this character after every <LI > close tag.
Now I could have simply replace saying replace string '<LI style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light">'
with '<LI style="FONT-SIZE: 7.5pt; FONT-FAMILY: Frutiger LT 45 Light">•'
But the problem is, in my search string, I have 'FONT-SIZE: 7.5pt' and in this string 7.5 may vary. This font size can be anything so I cannot just replace this with the same string and adding (•) at the end.
karthik
August 16, 2010 at 8:29 am
any inputs?
karthik
August 16, 2010 at 8:46 am
It is not the best solution to use T-SQL for these sort of tasks.
Formatting of data for GUI should be done in GUI itself or, at least, in your DAL layer.
If you want to do one-off transformation, you probably will be better off using SSIS.
However, if you really desperate to do it in T-SQL, you will need to create UDF function (better make it table-valued) which will parse your values and transform them.
As you can do simple replace, the logic in your UDF can be something like:
for a given value:
Loop While (Find open-tag for '<LI'
If (prev. found)
Find close-tag for LI - just the next '>' char
)
{
Build new value by adding whatever you want after close-tag
(SUBSTRING, LEFT and RIGHT T_SQL function would help you to do so)
}
It may be possible to make this function to perform better utilising Tally table techniques (you can find some article about this on this site)
Implementing the above functionality in C# (as CLR function), probably would be even better option.
August 17, 2010 at 1:49 am
how to achieve this by using CLR? I don't have any idea about CLR.
karthik
August 17, 2010 at 4:51 am
Can you code in C# or do you have anyone available with this skill (you don't need an expert for this task)?
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply