Re-formatting text in a table column

Posted on 2006-03-29
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.
Question by:thenone
    LVL 14

    Accepted 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
    LVL 8

    Author Comment

    so how would the sql statement look like for example my table is named table1 and column1
    LVL 15

    Expert Comment

    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
    LVL 8

    Author Comment

    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

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now