Read and parse comma-delimited file
Read and parse comma-delimited file
i need away to read from the end of the file to the begining instead of begining to end as this code does can anyone help me
using System;
using System.IO;
public class rev {
public static void Main(string[] a) {
string line;
string[] strings = new string[100];
char[] separate = {','};
int i, lineNum;
if (a.Length != 1) {
Console.WriteLine("Usage: prog.exe filename.filetype");
return;
}
StreamReader file = new StreamReader(a[0]);
lineNum = 0;
Console.WriteLine();
while ((line = file.ReadLine()) != null) {
++lineNum;
i = 0;
foreach (string arg in line.Split(separate)) {
i++;
strings[i] = arg.Trim();
Console.WriteLine("Line {0}, token{1}: {2}", lineNum, i, strings[i]);
}
Console.WriteLine();
}
file.Close();
}
}

juliet_zl69 reputationPosted Dec 16, 2003, 7:52 PM EST
shooff275 reputationPosted Dec 18, 2003, 10:59 AM EST
spgilmoreRank #1,616 · 964 reputationPosted Dec 19, 2003, 8:15 AM EST