I have code right now that reads in the file into an arraylist, but it reads
in each line of the text file as a single element rather than the separate
tab delimited strings in the line. Is there some way to split the text as
its being read in? The file is both tab delimited and has a carriage return
at the end of each line. Thanks!
using System;
using System.IO;
using System.Collections;
namespace try_again
{
class Class1
{
static void Main(string[] args)
{
StreamWriter swa = new StreamWriter ("c:\\afinal.txt");
StreamReader sra = new StreamReader ("c:\\ChristineWork\\test1.txt");
string aLine = "";
ArrayList aColumn = new ArrayList ();
while (aLine != null)
{
aLine = sra.ReadLine();
if (aLine != null)
{
string line = aLine.Split(new Char [] {' '});
aColumn.Add(aLine);
Console.WriteLine(">"+aLine+"<");
}
Console.ReadLine();
sra.Close();