有这样的内容
name1 0xABCD1231
name2 0xABCD1232
name3 0xABCD1233
name4 0xABCD1234
name与0x这间为空格
怎么么把他转化为:
0xABCD1231 name1
0xABCD1232 name2
0xABCD1233 name3
0xABCD1234 name4
------解决方案--------------------------------------------------------
F5刷新下就变成两个了
------解决方案--------------------------------------------------------
用列模式copy过去
------解决方案--------------------------------------------------------
什么是列模式??
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();