Strip only some CrLf and leave others


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Strip only some CrLf and leave others

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Strip only some CrLf and leave others

    [Originally posted by Anton]

    Input file example:

    IMPORTANT - READ CAREFULLY BEFORE ACCEPTING

    This is a legal agreement between you (the end user,
    being either an individual, or legal entity such as
    a corporation), and XXXX International Pty. Ltd. BY
    CLICKING THE "Accept" BUTTON, YOU ARE AGREEING TO BE
    BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT
    AGREE TO THE TERMS OF THIS AGREEMENT, IMMEDIATELY REMOVE
    ALL TRACES OF THE SOFTWARE PRODUCT FROM YOUR COMPUTER
    SYSTEM.

    PART I - ALL LICENSES GRANTS

    1. COPYRIGHT - software product ("SOFTWARE") is protected

    Desired Outcome:

    IMPORTANT - READ CAREFULLY BEFORE ACCEPTING

    This is a legal agreement between you (the end user, being either an individual, or legal entity such as a corporation), and XXXX International Pty. Ltd. BY CLICKING THE "Accept" BUTTON, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, IMMEDIATELY REMOVE ALL TRACES OF THE SOFTWARE PRODUCT FROM YOUR COMPUTER SYSTEM.

    PART I - ALL LICENSES GRANTS

    1. COPYRIGHT - software product ("SOFTWARE") is protected


    I only wish to strip the CRLF from the end of each line that make up the paragraphs of the documents. I want to keep the CRLF at the headings of each paragraph.

    My Code So Far:

    Dim Count1 As Integer
    Dim strTemp As String

    Private Sub Command1_Click()

    N = FreeFile()
    strFile = "D:\mp3\MFTE_ASR.txt"
    Open strFile For Input As #N
    strTemp = Input(LOF(N), #N)
    Close #N

    strTemp = Replace(strTemp, vbCrLf, "")

    RichTextBox1 = strTemp
    End Sub



    Please Help!

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Strip only some CrLf and leave others

    [Originally posted by Jim]

    Each paragraph ends with 2 crlfs. So replace any occurance of double crlfs with an odd character. Strip all crlfs then replace the odd characters with double crlfs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center