• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

Re-formatting text in a table column

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.
  • 2
1 Solution
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
thenoneAuthor Commented:
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
thenoneAuthor Commented:
computron I posted a comment on the original question I gave you if I can that to work then I will be happy.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now