std in conversion in dotnet

hivie

New member
Joined
Nov 4, 2003
Messages
1
I have a file that has say four columns and infinite rows. Before dotnet I would create a filestream object (inFile) and use it like this:
inFile >> data[1][0] >> data[1][1] >> data[1][2] and so on.

How can I do this same parsing using the streamreader or textreader? I cant seem to get this to work the same.
 
if you are trying to read the lines in from a file 1 at a time,
C#:
//C++ ( vs 2002 )
	StreamReader* sReader = new StreamReader(new FileStream ("C:\\your_textfile_path.txt", FileMode::Open, FileAccess::Read));
	while(sReader->Peek() !=-1)
	{   
		Console::WriteLine(sReader->ReadLine());
	}
 
Back
Top