Return to Snippet

Revision: 33553
at October 10, 2010 07:54 by itinko


Initial Code
StreamReader reader = new StreamReader(filePath);
string line;

//Assume that is a tab, if space change to " ".ToCharArray()
char[] splitChar = "\t".ToCharArray();

while(null != (line = reader.ReadLine))
{
string[] split = line.Split(splitChar);

int bit= int.Parse(split[0]);
string name = split[1];
string description = split[2];

//Do something with parse here?
}

reader.Dispose();

Initial URL


Initial Description
found this on a forum comment thought it would be useful

Initial Title
parse text file in C#

Initial Tags
text

Initial Language
C#