In this article, we will perform the process of extracting the data in our text file named file.txt with C #.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
using System; using System.IO; using System.Text; class Program { public static void Main(String[] args) { var text = File.ReadLines("file.txt"); // var text = File.ReadLines("file.txt",Encoding.GetEncoding("iso-8859-9")); foreach (var line in text) { Console.WriteLine(line); } Console.ReadLine(); } } |
Output: