M
microsoft.news.com
this is the entire function in the code.
it reads the file, gets the item at position 31, which is 10 characters
then takes that and populates a word doc.
the code is right here and i can compile it and get it working. BUT when the
first line is only 20 characters long - in which it should be it breaks. I
get the following errror : input string is in the incorrect format.
and it will no longer process.
the entire thing is here.
static void ReadFile()
{
StreamReader sr = new StreamReader("file.txt")
{
string line = sr.ReadLine();
while ((line = sr.ReadLine()) !=null)
{
//needs to start reading from line 2 not line 1
string name = line.SubString(31,10);
//take the name value and generate an word document
}
sr.Close();
}
}
it reads the file, gets the item at position 31, which is 10 characters
then takes that and populates a word doc.
the code is right here and i can compile it and get it working. BUT when the
first line is only 20 characters long - in which it should be it breaks. I
get the following errror : input string is in the incorrect format.
and it will no longer process.
the entire thing is here.
static void ReadFile()
{
StreamReader sr = new StreamReader("file.txt")
{
string line = sr.ReadLine();
while ((line = sr.ReadLine()) !=null)
{
//needs to start reading from line 2 not line 1
string name = line.SubString(31,10);
//take the name value and generate an word document
}
sr.Close();
}
}