怎么从A.TXT中提取我需要的行,存储到B.TXT呢(初学者求教)谢谢
2012-10-24 12:51:53,838 [0x00005c44] INFO root - 桩腿- 2 , 高度 =36.235 Num = 85
2012-10-24 12:51:53,911 [0x00005c44] INFO root - 倾斜, X =0.060 ,Y=-0.020
2012-10-24 12:51:54,267 [0x00005c44] INFO root - 桩腿- 1 , 高度 =34.358 Num = -907
2012-10-24 12:51:54,567 [0x00005c44] INFO root - 水深 深度=34.157
2012-10-24 12:51:54,723 [0x00005c44] INFO root - 气隙,高度=25.537
2012-10-24 12:51:54,911 [0x00005c44] INFO root - 倾斜, X =-0.040 ,Y=-0.070
2012-10-24 12:51:55,557 [0x00005c44] INFO root - 水深 深度=63.515
2012-10-24 12:51:55,723 [0x00005c44] INFO root - 气隙,高度=25.537
2012-10-24 12:51:55,879 [0x00005c44] INFO root - 桩腿- 2 , 高度 =36.235 Num = 85
2012-10-24 12:51:55,908 [0x00005c44] INFO root - 倾斜, X =-0.040 ,Y=-0.010
2012-10-24 12:51:56,133 [0x00005c44] INFO root - 桩腿- 3 , 高度 =29.427 Num = -4412
2012-10-24 12:51:56,309 [0x00005c44] INFO root - 桩腿- 1 , 高度 =34.358 Num = -907
2012-10-24 12:51:56,564 [0x00005c44] INFO root - 水深 深度=35.443
2012-10-24 12:51:56,723 [0x00005c44] INFO root - 气隙,高度=25.537
2012-10-24 12:51:56,911 [0x00005c44] INFO root - 倾斜, X =-0.080 ,Y=-0.050
2012-10-24 12:51:57,724 [0x00005c44] INFO root - 气隙,高度=25.537
2012-10-24 12:51:57,910 [0x00005c44] INFO root - 倾斜, X =0.060 ,Y=0.020
2012-10-24 12:51:57,920 [0x00005c44] INFO root - 桩腿- 2 , 高度 =36.235 Num = 85
2012-10-24 12:51:58,174 [0x00005c44] INFO root - 桩腿- 3 , 高度 =29.424 Num = -4414
2012-10-24 12:51:58,350 [0x00005c44] INFO root - 桩腿- 1 , 高度 =34.358 Num = -907
2012-10-24 12:51:58,560 [0x00005c44] INFO root - 水深 深度=24.835
2012-10-24 12:51:58,723 [0x00005c44] INFO root - 气隙,高度=25.537
我只要 带 “倾斜” 的行。。 求源代码。。 C#初学者。。 尽量 解释 清楚点。。 谢谢 了。
c#?文件?txt??提取
c#
文件
提取
------解决方案--------------------路径中的\符号要转义
把("e:\a.txt",改成("e:\\a.txt",
e:\b.txt也改成e:\\b.txt
StreamReader sr = new StreamReader(
"e:\\a.txt", Encoding.Default); FileStream fs = new FileStream(
"e:\\b.txt", FileMode.Create, FileAccess.Write, FileShare.None); StreamWriter sw = new StreamWriter(fs, Encoding.Default); string strLine = sr.ReadLine();