We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Re-formatting text in a table column

thenone asked
Medium Priority
Last Modified: 2010-05-01
is there a sql statement that I can use that will remove all indentation,new lines,carriage returns and all double white spaces triple white spaces etc.
Watch Question

try followings:

convert_indents_to_mixed ()
Convert all lines with leading spaces to mixed tabs and spaces.

convert_indents_to_spaces_only ()
Convert all lines containing leading tabs to spaces only.

convert_indents_to_tabs_only ()
Convert all indentation to use tab characters only and no spaces

Hope this helps

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


so how would the sql statement look like for example my table is named table1 and column1
TheOne, if you run your HTML page through the following function, then run it through the function I gave you earlier, you will eliminate all html tags, carraige returns, linefeeds, tabs, and extra whitespace. What you'll be left with is unformatted raw text. Not sure if your still trying to complete the entire stripping of HTML.

Public Function StripHTMLCRLFTab(strOrigString As String, strCharacter As String) As String
    Dim lCounter As Long, sResult As String, bInTag As Boolean
    Dim bInsert As Boolean, strChar As String

    For lCounter = 1 To Len(strOrigString)
        strChar = Mid(strOrigString, lCounter, 1)
        If strChar = "<" Then
            bInTag = True
        ElseIf strChar = ">" Then
            bInTag = False
            bInsert = True
        ElseIf strChar = vbCr Then
            bInTag = True
        ElseIf strChar = vbLf Then
            bInTag = True
        ElseIf strChar = vbTab Then
            bInTag = True
            If bInTag = False And bInsert = True Then
                sResult = sResult & strCharacter & strChar
                bInsert = False
            ElseIf bInTag = False Then
                sResult = sResult & strChar
            End If
        End If
    StripHTMLCRLFTab = sResult

End Function


computron I posted a comment on the original question I gave you if I can that to work then I will be happy.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.