You may replace
foreach (string word in text[count].Split(','))
{
//here i want to put each data in the Earthquake class
}
with following code lines and see if it helps
foreach (string line in text)
{
string[] myColumns = line.Split(',');
EarthQuake eQ = new EarthQuake(myColumns[0],myColumns[1],myColumns[2],myColumns[3],myColumns[4],myColumns[5],myColumns[6],myColumns[7],myColumns[8]);
//Add eQ into a list you want to save
}
This assumes the columns are in same order. If the order is different than rather than using this constructor, use default constructor and then assign values to the properties of EarthQuake class accordingly.
Hope that helps.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…