hiya.
I'm trying to read in a text file, then split each line and output it to a listbox. However its not that easy.
every 7 lines is about one subject so i need the listbox to write the data out like this.
line 1, line 2, line 3, line 4, line 5, line 6, line 7 \\then move onto the next subject.
i can read in the file using streamreader
// Read the file.
System.IO.StreamReader modules =
new System.IO.StreamReader("C:/Documents and Settings/Paul/My Documents/uni/Reynolds10178862/C#Application/Modules/Modules/modules_v2.txt");
and i am using this while loop to split the file.
while ((line = modules.ReadLine()) != null)
{
counter++;
String[] splittedint = line.Split('\t');
String mcode = line.Split('\t')[0];
reportbox.Items.Add(mcode);
}
but this seems to write out the first symbol from each line, rather then each line. I was thinking maybe i need to assign each line to a string to do what is required but im not entirely sure.
can anyone help?