How to split data in a text file in C#.This is how my data looks: name: abcsurname: abctel:1234 and

Posted by userJD on Stack Overflow See other posts from Stack Overflow or by userJD
Published on 2010-04-22T11:10:46Z Indexed on 2010/04/22 11:13 UTC
Read the original article Hit count: 131

Filed under:

`public void SeparateData() { //read file StreamReader sr = new StreamReader("myTextFile.txt"); //string to hold line string myline; myline = sr.ReadLine(); while ((myline = sr.ReadLine()) != null) { string[] lines = Regex.Split(myline, " "); foreach (string s in lines) { using (StreamWriter sw = new StreamWriter("myTextFile.txt")) sw.WriteLine(lines); }

            }
        }      `

© Stack Overflow or respective owner

Related posts about c#3.0