A tab delimited txt file is being read line by line into a list of strings. the aim is to process each word of the string with the format type of the string like datetime or, float or string of characters etc.? so that the data can be plotted . Is there any other efficient way to do this?
using (StreamReader file = new StreamReader(@"C:\Users\\Desktop\snpprivatesellerlist.txt"))
{
while ((line = file.ReadLine()) != null)
{
char[] delimiters = new char[] { '\n' };
string[] parts = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < parts.Length; i++)
{
st = parts[i];
// process the line - if part[i] is date time - do something ()
// if part[i] is a float - do something else()
}
}
}
Any help and insight is appreciated.
Thanks.
The code that kinda solved my issue – but i am still working it.
I am trying to follow it on this thread – https://stackoverflow.com/questions/10719396/iterating-separating-list-of-string-arrays-based-on-first-element
Thanks all for the help. Please do point out if you spot any mistakes in code.