Re: TextFieldParser question
I don't really understand what you mean by "stop" at the end of each line. Do you mean you want to get some input from the user after each line? Please provide a clearer explanation of exactly what you're trying to achieve.
Re: TextFieldParser question
Sorry, here is more detail.
Dim row As String()
While Not tf.EndOfData
row = tf.ReadFields()
For Each field As String In row
MessageBox.Show(field)
//need to add code in the end of each record, how?
Next
After code above, data will show like below:
company1, location1, name1 (end of first record, I need to output to file1)
company2, location2, name2 (end of second record, I need to output to file2)
...
company10, location10, name10 (end of tenth record, I need to output to file10)
I need to determine where is the end of each record so that I can sent output file.
Re: TextFieldParser question
So what you're actually saying is that you need to output each row to a separate file, correct? If so then that's exactly what you do. You simply add code inside the loop that writes the current row to a file.
Re: TextFieldParser question
Thank you.
Another question:
In order to get the value for each cell in the same row, I use code below using array.
Is it possible to do the same job from TextFieldParser only?
Dim Fields() As String
While Not tf.EndOfData
Fields = tf.ReadFields()
s1 = Fields(0)
s2 = Fields(1)
s3 = Fields(2)
End While
Re: TextFieldParser question
Evereything a TextFieldParser can do is in the documentation for the TextFieldParser class. If you want to read field values then that's how you do it.