读取c:\test.txt 数据并写入及生成 c:\out.txt文本
目的: 只提取RP和RPTWIN 有数据的行.提取数据为:RP值, RPTWIN值,及EM值,并当EM状态为AB,MB,CB时候提取!黑体部分为需要提取的数据!!!
c:\test.txt 内容如下:
<exemp:rp=all,em=all;
EM DATA
RP TYPE EM EQM TWIN CNTRL PP STATE
12 RP4L1A 0 CLT-0 13 PRIM CB
12 RP4L1A 1 CLT-1 13 PRIM CB
12 RP4L1A 2 CLT-2 13 SEC CB
13 RP4L1A 0 CLT-0 12 SEC CB
13 RP4L1A 1 CLT-1 12 SEC CB
13 RP4L1A 2 CLT-2 12 PRIM CB
32 RP4L1G 0 TSM-0 33 PRIM AB
32 RP4L1G 1 TSM-0 33 PRIM AB
32 RP4L1G 2 TSM-1 33 SEC MB
32 RP4L1G 3 TSM-1 33 SEC MB
32 RP4L1G 4 TSM-1 33 SEC WO
32 RP4L1G 10 TSM-5 33 SEC MB
33 RP4L1G 0 TSM-0 32 SEC AB
33 RP4L1G 1 TSM-0 32 SEC AB
33 RP4L1G 2 TSM-1 32 PRIM MB
33 RP4L1G 3 TSM-1 32 PRIM MB
33 RP4L1G 4 TSM-1 32 PRIM WO
33 RP4L1G 10 TSM-5 32 SEC MB
384 RP4S1A 8 ETMALT- 385 PRIM MB
384 RP4S1A 10 ASDS3-5120 385 PRIM MB
385 RP4S1A 8 ETMALT- 384 SEC MB
385 RP4S1A 10 ASDS3-5120 384 SEC MB
386 RPPS1 0 MIWUTS-320&&-335 PRIM CB
387 RPG2A 0 C7ST2C-320&&-323 PRIM MB
388 RPG3A 0 C7ST2C-324&&-327 PRIM CB
生成 c:\out.txt文本内容如下:
bleme:rp=12,rpt=13,em=0;
bleme:rp=12,rpt=13,em=1;
bleme:rp=12,rpt=13,em=2;
bleme:rp=32,rpt=33,em=0;
bleme:rp=32,rpt=33,em=1;
bleme:rp=32,rpt=33,em=2;
bleme:rp=32,rpt=33,em=3;
bleme:rp=32,rpt=33,em=10;
bleme:rp=384,rpt=385,em=8;
bleme:rp=384,rpt=385,em=10;
恳请高手帮忙解决啊!!!
谢谢!!!!!