日期:2014-05-18 浏览次数:21458 次
StreamReader sr = new StreamReader(@"C:\Users\xwy\Desktop\123.txt", Encoding.GetEncoding("GB2312"));
StreamWriter sw = new StreamWriter(@"C:\Users\xwy\Desktop\T.txt", true);
while (!sr.EndOfStream)
{
string row = sr.ReadLine();
string[] columns = row.Split(new char[] { ',' });
sw.WriteLine("xxxxxx{0}xxxx{1}xxxx", columns[0], columns[1]);
}
sw.Flush();//关闭不要放到循环里面
sw.Close();