日期:2014-05-20 浏览次数:20764 次
FileStream read = new FileStream("F:\\12.txt", FileMode.Open);
FileStream write = new FileStream("F:\\12W.txt", FileMode.Create);
StreamReader m_streamReader = new StreamReader(read);
StreamWriter m_streamWrite = new StreamWriter(write);
m_streamReader.BaseStream.Seek(0, SeekOrigin.Begin);
string arry = "";
string strLine = m_streamReader.ReadLine();
do
{
string[] split = strLine.Split();
string name = split[0];
string address = "";
for (int i = 1; i < split.Count(); i++)
{
if (split[i].Contains("0x"))
{
address = split[i];
break;
}
}
strLine = m_streamReader.ReadLine();
m_streamWrite.WriteLine(address + " " + name);
} while (strLine != null && strLine != "");
m_streamWrite.Flush();