B
BlueOysterCult
Hello all
I have a project that I have to read the file - which I have done I
can see the file output. I then need to read the line - parse the
line into three separate values (there are 3 = name age and gender)
static void DoPartD()
{
FileInfo theSourceFile = new FileInfo(@"c:\\Documents and
Settings\\Rob\\School\\CIS 252\\Ass2\\people.DAT");
StreamReader reader = theSourceFile.OpenText();
StreamWriter writer = new StreamWriter(@"c:\\Documents and
Settings\\Rob\\School\\CIS 252\\Ass2\\people.BAK",false);
string text;
do
{
text = reader.ReadLine();
writer.WriteLine(text);
Console.WriteLine(text);
} while (text != null);
reader.Close();
writer.Close();
}
I am not sure how to read just one line at a time to parse them
like I said, I can see all the lines when
Console.writeline(text)......
It is delimited with a semi colon
Thanks
Rob
I have a project that I have to read the file - which I have done I
can see the file output. I then need to read the line - parse the
line into three separate values (there are 3 = name age and gender)
static void DoPartD()
{
FileInfo theSourceFile = new FileInfo(@"c:\\Documents and
Settings\\Rob\\School\\CIS 252\\Ass2\\people.DAT");
StreamReader reader = theSourceFile.OpenText();
StreamWriter writer = new StreamWriter(@"c:\\Documents and
Settings\\Rob\\School\\CIS 252\\Ass2\\people.BAK",false);
string text;
do
{
text = reader.ReadLine();
writer.WriteLine(text);
Console.WriteLine(text);
} while (text != null);
reader.Close();
writer.Close();
}
I am not sure how to read just one line at a time to parse them
like I said, I can see all the lines when
Console.writeline(text)......
It is delimited with a semi colon
Thanks
Rob