Obzirom da rece preko IM-a da je u pitanju CSV koji se onda parsira, i treba da se izbegnu prazni redovi,
moglo bi ovako, malo sirovo ali radi.
Code:
using System.IO;
....
try
{
string myFile = Server.MapPath("~\\file.csv"); //enter path to yor file
using (StreamReader sr = new StreamReader(myFile))
{
String line;
// Read and display lines from the file until the end of
// the file is reached.
while ((line = sr.ReadLine()) != null)
{
string[] myLine = line.Split(new char[] { ',', ' ' }); //add separators
bool fHasValue = false;
for (int i = 0; i < myLine.Length; i++)
{
if (myLine[i].Length > 0)
{
fHasValue = true;
}
}
if (fHasValue == false)
{
Trace.Warn("empty line is " + line);
// empty row
}
else
{
Trace.Warn(" line is " + line);
//do something :)
}
}
}
}
catch (Exception ex)
{
// Let the user know what went wrong.
Trace.Warn("The file could not be read:");
Trace.Warn(ex.Message);
}
Idle mind is the devils playground, in my case it turned out to be an amusement park.
Sustina problema ove zemlje:
Legeonar_: Sto pre treba da shvatite da je EU propast i da se tamo mora raditi,a ne samo biti zaposlen.
http://www.elitemadzone.org/p1864861
Nobody Remains Virgin, Life Fucks Everyone