Help!!!
im trying to change the format of a .txt doc from
acc:,123,name,ere,phone,545 etc
acc,233,name,eee,phone,555 ect
to look like this
acc name phone
123 ere 545
233 eee 555
How do i put the headings one array and print them on the top and values below the appropriate heading i have this so far
int StartIndex = 0;
int LastIndex = 0;
string strText = "";
System.IO.StreamReader myFile =
new System.IO.StreamReader("ADDR.txt");
string myString = myFile.ReadToEnd();
myFile.Close();
StreamWriter sw = new StreamWriter("ADDR1.txt");
//string[] year = commaDelimited;
string commaDelimited = myString;
StartIndex = LastIndex +1;
LastIndex = commaDelimited.IndexOf(",",StartIndex);
string [] year = commaDelimited.Split(new char[]{','});
foreach (string month in year)
{
sw.WriteLine("{0}",month);
}
sw.Close();
Replies
Know the answer? Post it — somebody with the same question will find it here.