Posted on: 3/31/2012 11:43:39 AM | Views : 515

Hi
i am using streamreader to read a text file
also i am using readline to read lines one by one.
But it is reading alternate lines only,means it is skiping alternate lines.
any help?
code:
using (StreamReader sr = new StreamReader(Server.MapPath("~/Mutual Fund Data/Navhist_HL.ace")))
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
con.Open();
while (sr.ReadLine() != null)
{
string x = sr.ReadLine();
string[] y = Regex.Split(x, "<<row>>");
string p = y[1];
string[] q = Regex.Split(p, "<</row>>");
string r = q[0];
string[] s = r.Split('|');
}
}
}

sample text data:
<<row>>1|10.003|10.003|2012-03-19 00:00:00.000|2012-03-19 00:00:00.000|10.003|10.003|2012-03-19 00:00:00.000|2012-03-19 00:00:00.000|10.003|10.003|2012-03-19 00:00:00.000|20 ...

Go to the complete details ...