public class data { public string date, time, mag, depth; public double lat, lon; } private void view_file_Load(object sender, EventArgs e) { string str; List<data> gd = new List<data>(); try { using (StreamReader sr = new StreamReader("C:\\Windows\\Temp\\op.txt")) { string line; while ((line = sr.ReadLine()) != null) { string[] arr = line.Split(new char[] { ' ' }, System.StringSplitOptions.RemoveEmptyEntries); while (sr.Peek() > 0) { string[] s = new string[] { " " }; char[] c = new char[] { ' ' }; str = sr.ReadLine(); arr = str.Split(c); data d = new data(); d.date = arr[0]; d.time = arr[1]; d.lat = Convert.ToDouble(arr[3]); d.lon = Convert.ToDouble(arr[4]); d.depth = arr[7]; d.mag = arr[8]; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)