Start New Discussion within our Software Development Community

I have a headache over this one. what i am trying to do is take the text from a multi-line textbox and put it into one line so i can put that into a file for another program to read one line at a time. is there some way to do this so the file is small and streamreader can read one line at a time.

heres the code that writes to the file and compiles the textbox:

Dim ENTER As String = Chr(13)' I Tried vbcrlf here but it still didnt work.
            Dim delimiters() As Char = {CChar(ENTER)}
            Dim TD, D1, D2, D3, D4, inp() As String
            Dim ipart As IEnumerator
            If TextBox4.Text = Nothing Then
                D2 = "_"
            Else
                D2 = TextBox4.Text
            End If
            D1 = TextBox1.Text
            inp = TextBox2.Text.Split(delimiters)
            ipart = inp.GetEnumerator
            While ipart.MoveNext
                D3 = D3 & Mid(ipart.Current.ToString, 1, ipart.Current.length - 1) & "Û"
            End While
            inp = TextBox3.Text.Split(delimiters)
            ipart = inp.GetEnumerator
            While ipart.MoveNext
                D4 = D4 & Mid(ipart.Current.ToString, 2, ipart.Current.length) & "Û"
            End While
            sd.WriteLine(D1 & "þ" & D2 & "þ" & D3 & "þ" & D4)

Thanks in advanced

The following code replaces the CR+LF that separates the lines in a multiline textbox by a text that will hopefully never be entered by any user.
I tested this with german culture settings.

Dim sLine As String
        sLine = Replace(TextBox1.Text, vbCr & vbLf, ":AxAxA:")
        Dim writer As New StreamWriter("temp.txt", False)
        writer.WriteLine(sLine)
        writer.Close()

        Dim reader As New StreamReader("temp.txt")
        sLine = reader.ReadLine
        reader.Close()
        TextBox2.Text = Replace(sLine, ":AxAxA:", vbCr & vbLf)
This question has already been answered. Start a new discussion instead.