loops - Reading a delimited text file by line and by delimiter in C# -


i apologise mposting this, there lot of questions here can't find 1 specific this.

i have list , each item contains datetime, int , string. have written list items .txt file delimited commas. example 09/04/2015 22:12:00,10,posting on stackoverflow.

i need loop through file line line, each line starting @ index 0, through index 2. @ moment able call index 03, returns datetime of second list item in text file. file written line line, struggling read delimiters , line breaks.

i sorry if not making sense, appreciate help, thank you.

string[] lines = file.readalllines( filename ); foreach ( string line in lines ) {   string[] col = line.split( new char[] {','} );   // process col[0], col[1], col[2] } 

Popular posts from this blog