Hai,
I am trying to convert csv to html by using stream reader and writing that into stream writer the problem is it is missing the last line of the csv file i debugged and tried tracing stream reader but i am unable see stream reader output in the watch at each loop .
string Line, path = @"C:\Vertex\nov\Source\Reports\Rpt_Disconn_and_Rec onn_List_for_Customer_Operations_Results.csv";
System.IO.StreamReader ObjectStreamReader = null;
System.IO.StreamWriter ObjectStreamWriter = null;
ObjectStreamReader = new System.IO.StreamReader(path);
ObjectStreamWriter = new System.IO.StreamWriter("result.html");
Line = ObjectStreamReader.ReadLine();
ObjectStreamWriter.Write("<html><head><table border =1><>");
ObjectStream.Writer.Write(""):
while (ObjectStreamReader.Peek() > -1)
{
Line = ObjectStreamReader.ReadLine();
ObjectStreamWriter.WriteLine("<tr><td>" + string.Join("</td><td>", Line.Split('\t')) + "</td></tr>");
}
ObjectStreamWriter.WriteLine("</table></body></html>");
Thanks in advance