G
Guest
Greetings all
I'm trying to export text to a file but the format comes out incorrectly
I'm trying to have an array exported to a text file side by side
Example
Name:
John Doe Jane Doe Sally Joe
45 no address 12 no address 78 has address
123-123-4345 123-233-1234 342-342-2342
The problem is that I can't get the arraylist to come out side by side why is this?
see code below
Dim LineValues() As String
Dim sw As New StreamWriter("v:\test.txt")
Dim counter As Integer
Dim c As New ArrayList
If ComboBox1.Visible = True Then
lboElements.Items.Add(name1.Text & address1.Text & number1.Text)
lboElements.Items.Add(name2.Text & address2.Text & number2.Text)
With c
.Add(name1.Text & Chr(10) &address1.Text & number1.text)
.Add(name2.Text & Chr(10) & address2.Text & number2.text)
End With
For counter = 0 To c.Count() - 1
LineValues = CType(c(counter), String())
MessageBox.Show(LineValues(0))
'Call sw.WriteLine(text1(0) & " - " & text1(1))
Next
sw.Close()
MessageBox.Show("saved")
I'm trying to export text to a file but the format comes out incorrectly
I'm trying to have an array exported to a text file side by side
Example
Name:
John Doe Jane Doe Sally Joe
45 no address 12 no address 78 has address
123-123-4345 123-233-1234 342-342-2342
The problem is that I can't get the arraylist to come out side by side why is this?
see code below
Dim LineValues() As String
Dim sw As New StreamWriter("v:\test.txt")
Dim counter As Integer
Dim c As New ArrayList
If ComboBox1.Visible = True Then
lboElements.Items.Add(name1.Text & address1.Text & number1.Text)
lboElements.Items.Add(name2.Text & address2.Text & number2.Text)
With c
.Add(name1.Text & Chr(10) &address1.Text & number1.text)
.Add(name2.Text & Chr(10) & address2.Text & number2.text)
End With
For counter = 0 To c.Count() - 1
LineValues = CType(c(counter), String())
MessageBox.Show(LineValues(0))
'Call sw.WriteLine(text1(0) & " - " & text1(1))
Next
sw.Close()
MessageBox.Show("saved")