I am trying to read a text file and save it in a list of arrays. It works without errors. Inside my text file it is.
277.18
311.13
349.23
277.18
311.13
349.23
277.18
311.13
349.23
but on console output I see this most of the data.
277.18
311.13
349.23
349.23
**329.63
329.63
293.66
293.66
261.63
293.66
329.63
349.23
392**
277.18
311.13
349.23
277.18
311.13
349.23
277.18
311.13
349.23
Bold numbers in a text file are also highlighted. Here is my code. how to solve it ?? can someone help me .. please ...
OpenFileDialog txtopen = new OpenFileDialog();
if (txtopen.ShowDialog() == DialogResult.OK)
{
string FileName = txtopen.FileName;
string line;
System.IO.StreamReader file = new System.IO.StreamReader(FileName.ToString());
while ((line = file.ReadLine()) != null)
{
list.Add(double.Parse(line));
}
foreach (double s in list)
{
Console.WriteLine(s);
}
}
source
share