Answers for "c# code to read txt file line by line and split"

C#
3

c# read file by line

using (var file = new StreamReader(fileName)) {
	string line;
	while((line = file.ReadLine()) != null)  
	{  
		System.Console.WriteLine(line);
	}  
}
Posted by: Guest on July-28-2021
0

c# code to read txt file line by line and split

string lines = File.ReadAllText(path);
string [] split_arr = lines.Split(';')//files containt ; seprated values
  foreach(string l in split_arr)
  {
    Console.WriteLine(l);
  }
Posted by: Guest on April-15-2022

Code answers related to "c# code to read txt file line by line and split"

C# Answers by Framework

Browse Popular Code Answers by Language