Reading more than column in a text file
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I am used to VB6 reading a few header items below each other out of a text file followed by some columns of data such as:
fh1 = FreeFile
Open inPath For Input As #fh1
Input #fh1, projfile.name
Input #fh1, projfile.projdate
Input #fh1, projfile.versionFor X = 1 To intNumVars Input #fh1, Bas(X).name, Bas(X).Min, Bas(X).Max, Bas(X).ave, Next X
Close(fh1)
I have been through a lot of material on StreamReader, BinaryReader etc and getting stuck. Any help (code examples) or pointers to articles, chapters would be much appreciated. The writing of the info to the file seems easy with :
StreamWriter outFS = new StreamWriter(new FileStream(outFile, FileMode.OpenOrCreate, FileAccess.Write));
outFS.WriteLine(strModelDesc1);
outFS.WriteLine(strModelDesc2);
outFS.WriteLine("{0},{1},{2}"intLayers, intStats, decAve);
outFS.Close();thanks Ian