Hello, I have a problem not far from the one quoted above, namely retrieving data from a text file containing the log file, and then convert each value and come out the graphic representation. And so far my code is not working as it should, and I just can not seem to get them all as it should, and suddenly I have need your aide.Thx advance.
the logfile is located in a folder in my computer, turning and with the low end of code if I try to read all the values of the text, but without success, because the values are read, but not all.
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
String Choosen_File = "";
OpenFD.InitialDirectory = "Y:";
OpenFD.Title = " Open a LoggFile";
OpenFD.FileName = "";
OpenFD.Filter = "Textdokument|*.txt|World Documents|*.doc|Microsoft Excel-Arbeitsblatt|*.";
//"TextFiles|*.txt|Word Documents|*.doc";
if (OpenFD.ShowDialog() != DialogResult.Cancel)
{
Choosen_File = OpenFD.FileName;
richTextBox1.LoadFile(Choosen_File, RichTextBoxStreamType.PlainText);
}
else
{
MessageBox.Show("Cancel Button Clicked");
}
}
private void button2_Click(object sender, EventArgs e)
{
// Read in a file line-by-line, and store it all in a List.
using (StreamReader reader = new StreamReader(OpenFD.FileName))
{
string line = null ;
String[] StArr = null;
char [] _Delimiters_char = {' ', ';', ','};
int count = 0;
while ((line = reader.ReadLine()) != null)
{
StArr =line.Split(_Delimiters_char);
for (count = 0; count <= StArr.Length - 1; count++)
{
MessageBox.Show(StArr[count]);
}
}
}
Example of said file
IBBPARA d RA d ƒ}ÅÄ
ô ¼ 2 2 n ä|Ôþ & P ‚}ÅÄ
ô ¼ 2 2 n ä|Ôþ & P )ÅÄ
ô ¼ 2 2 n ä|Ôþ & P ®ÅÄ
ô ¼ 2 2 n ä|Ôþ & P ‚}ÅÄ
ô ¼ 2 2 n ä|Ôþ & P ƒ}ÅÄ
ô ¼ 2 2 n ä|Ôþ & P ƒ