My text file is delimited (2 fields (text & numeric)). I'm trying to get the output into columnar format and include a count of the # of records following the columnar format. My text file is separated by commas. So far I can only read the text file. Here is
namespace ConsoleApplication5
{
public class Class1
{
static void Main(string[] args)
{
String line;
{
//Pass the file path and file name to the StreamReader constructor
StreamReader sr = new StreamReader("data.txt");
//Read the first line of text
line = sr.ReadLine();
//Continue to read until you reach end of file
while (line != null)
{
//write the line to console window
Console.WriteLine(line);
//Read the next line
line = sr.ReadLine();
}
//close the file
sr.Close();
Console.ReadLine();
}
}
}
}