标题: [文本处理] 如何提取文本内的指定行内容? [打印本页]
作者: pls 时间: 2016-3-24 13:22 标题: 如何提取文本内的指定行内容?
本帖最后由 pcl_test 于 2016-3-24 13:37 编辑
51201 09:16:26.159, 2016-03-12 P_EPHY_ERRC_INTRAF_MEAS_REPORT_IND
Message content
{
source-id
{
L1c
[0]HLP
}
dest-id
{
ERRC
[0]EMCFE
}
P_EPHY_ERRC_INTRAF_MEAS_REPORT_IND_param_v2
{
ssfn_cycle : 70 [0x0046]
ssfn : 3872 [0x0f20]
trans_id : 1 [0x0001]
objectId : 1 [0x0001]
carrier_freq : 65300 [0xff14]
neigh_cell_num : 0 [0x0000]
_0_neighcell_meas_result_ast : 32[0x0020] items
{
0
{
phy_cell_id : "invalid" [0xffff]
rsrp_report_ind : 0 [0x0, 0(1 bits)]
rsrq_report_ind : 1 [0x1, 1(1 bits)]
spare : 1 [0x0001, 00000000 000001(14 bits)]
rsrp : 0.500 dBm [0x0005]
rsrq : -0.100 dB [0xffff]
}
1
{
phy_cell_id : "invalid" [0xffff]
rsrp_report_ind : 1 [0x1, 1(1 bits)]
rsrq_report_ind : 1 [0x1, 1(1 bits)]
spare : 16383 [0x3fff, 11111111 111111(14 bits)]
rsrp : -0.100 dBm [0xffff]
rsrq : -0.100 dB [0xffff]
}
2
{
phy_cell_id : "invalid" [0xffff]
rsrp_report_ind : 1 [0x1, 1(1 bits)]
rsrq_report_ind : 1 [0x1, 1(1 bits)]
spare : 16383 [0x3fff, 11111111 111111(14 bits)]
rsrp : -0.100 dBm [0xffff]
rsrq : -0.100 dB [0xffff]
}
3
{
phy_cell_id : "invalid" [0xffff]
rsrp_report_ind : 1 [0x1, 1(1 bits)]
rsrq_report_ind : 0 [0x0, 0(1 bits)]
spare : 0 [0x0000, 00000000 000000(14 bits)]
rsrp : -1 dBm [0xfff6]
rsrq : 12 dB [0x0078]
}
4
{
phy_cell_id : "invalid" [0x0f1f]
rsrp_report_ind : 0 [0x0, 0(1 bits)]
rsrq_report_ind : 0 [0x0, 0(1 bits)]
spare : 16325 [0x3fc5, 11111111 000101(14 bits)]
rsrp : 0.500 dBm [0x0005]
rsrq : -0.100 dB [0xffff]
}
文档里有很多这样的类似的代码,想把带时间那行和3大括号里的” rsrq : “这行提取出来,请支招。
作者: happy886rr 时间: 2016-3-24 13:47
回复 1# pls - @echo off
- type test.txt|findstr /r "[012][0-9]:[0-5][0-9]:[0-5][0-9]"
- type test.txt|findstr /i /r /c:"rsrq : [0-9]* dB \[0x[0-9]*\]"
- pause>nul
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |