hi,
i want to know the total number of lines in the document because i will use it as iteration statment like or example
for(i=0, i < totallinenumber, i++)
myarray
= mystreamreader;
is there any way to do that or at least to get the lines to my array
also i want to know if the streamreader riched to the end of document or not
thx

Q: about StreamReader
renz_wales
p4praveen
using(StreamReader reader = new StreamReader(@"c:\myfile.txt"))
{
string line = null;
int lineCounter = 0;
while( (line = reader.ReadLine()) != null)
{
// Higher the line counter with 1.
lineCounter++;
// TODO: Do something with the readed line.
}
}
Stefano Straus
hi,
many thx it working fine
i just wondering , every tutorial i saw it was closing the stream reader like for example reader.close(); but when i tried to close this stream it maked it as error
and also can i just use this as a counter without doing anything with data or the data will be in computer memory
i'm asking this for one reason i have 2 files in different languages (one english, other one arabic) i want to put them in a table (line number, arabic , english)
best regards