Print a certain string only the first time it appears in a test file - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Print a certain string only the first time it appears in a test file (/thread-28514.html) |
Print a certain string only the first time it appears in a test file - buttercup - Jul-22-2020 Hey all. I have a large text file that contains several repetitive statements along with other text. (Shown in python tags to get a scrollbar) P3 Rest Octets H... .... = Channel Needed 3 & 4: Present .11. .... = Channel 3: TCH/H or TCH/F (Dual rate) (3) ...1 1... = Channel 4: TCH/H or TCH/F (Dual rate) (3) .... .L.. = NLN(PCH): Not Present .... ..L. = Priority 1: Not Present .... ...L = Priority 2: Not Present L... .... = Priority 3: Not Present .L.. .... = Priority 4: Not Present Padding Bits: default padding Frame 27: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.707941000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.707941000 seconds [Time delta from previous captured frame: 0.004602000 seconds] [Time delta from previous displayed frame: 0.004602000 seconds] [Time since reference or first frame: 0.265246000 seconds] Frame Number: 27 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm:gsm_a.dtap] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18b8 (6328) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23f0 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 1, Channel: SDCCH/8 (2) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 1 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585904 Channel Type: SDCCH/8 (8) Antenna Number: 5 Sub-Slot: 2 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x03 .00. .... = LPD: Normal GSM (0) ...0 00.. = SAPI: RR/MM/CC (0) .... ..1. = C/R: 1 .... ...1 = EA: Final octet (1) Control field: I, N(R)=2, N(S)=2 (0x44) 010. .... = N(R): 2 .... 010. = N(S): 2 .... ...0 = Frame type: Information frame (0x0) Length Field: 0x09 0000 10.. = Length: 2 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) [2 Message fragments (22 bytes): #5(20), #27(2)] [Frame: 5, payload: 0-19 (20 bytes)] [Frame: 27, payload: 20-21 (2 bytes)] [Message fragment count: 2] [Reassembled LAPDm length: 22] GSM A-I/F DTAP - Location Updating Accept Protocol Discriminator: Mobility Management messages (5) .... 0101 = Protocol discriminator: Mobility Management messages (0x5) 0000 .... = Skip Indicator: No indication of selected PLMN (0) 00.. .... = Sequence number: 0 ..00 0010 = DTAP Mobility Management Message Type: Location Updating Accept (0x02) Location Area Identification (LAI) Location Area Identification (LAI) - 410/01/10470 Mobile Country Code (MCC): Pakistan (410) Mobile Network Code (MNC): Mobilink (01) Location Area Code (LAC): 0x28e6 (10470) Mobile Identity - TMSI/P-TMSI (0x462b5dfb) Element ID: 0x17 Length: 5 1111 .... = Unused: 0xf .... 0... = Odd/even indication: Even number of identity digits .... .100 = Mobile Identity Type: TMSI/P-TMSI/M-TMSI (4) TMSI/P-TMSI: 0x462b5dfb PLMN List Equivalent - 2 PLMNs Element ID: 0x4a Length: 6 PLMN[1] Mobile Country Code (MCC): 410 Mobile Network Code (MNC): 01 PLMN[2] Mobile Country Code (MCC): 410 Mobile Network Code (MNC): 07 Frame 28: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.715805000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.715805000 seconds [Time delta from previous captured frame: 0.007864000 seconds] [Time delta from previous displayed frame: 0.007864000 seconds] [Time since reference or first frame: 0.273110000 seconds] Frame Number: 28 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:gsm_a.ccch] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18b9 (6329) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23ef [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 0, Channel: CCCH (1) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 0 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -42 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585908 Channel Type: CCCH (2) Antenna Number: 104 Sub-Slot: 1 GSM CCCH - Paging Request Type 2 L2 Pseudo Length 0010 11.. = L2 Pseudo Length value: 11 .... 0110 = Protocol discriminator: Radio Resources Management messages (0x6) .... 0110 = Protocol discriminator: Radio Resources Management messages (0x6) 0000 .... = Skip Indicator: No indication of selected PLMN (0) Message Type: Paging Request Type 2 Page Mode .... 0000 = Page Mode: Normal paging (0) Channel Needed ..11 .... = Channel 1: TCH/H or TCH/F (Dual rate) (3) 11.. .... = Channel 2: TCH/H or TCH/F (Dual rate) (3) TMSI/P-TMSI - Mobile Identity 1 TMSI/P-TMSI TMSI/P-TMSI Value: 0x5e304054 TMSI/P-TMSI - Mobile Identity 2 TMSI/P-TMSI TMSI/P-TMSI Value: 0x452b53d4 P2 Rest Octets L... .... = Channel Needed 3: Not Present .L.. .... = NLN(PCH): Not Present ..L. .... = Priority 1: Not Present ...L .... = Priority 2: Not Present .... L... = Priority 3: Not Present .... .L.. = Packet Paging Procedure 1: For RR connection establishment .... ..L. = Packet Paging Procedure 2: For RR connection establishment .... ...L = Packet Paging Procedure 3: For RR connection establishment L... .... = Additions in release 6: Not Present Padding Bits: default padding Frame 29: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.716563000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.716563000 seconds [Time delta from previous captured frame: 0.000758000 seconds] [Time delta from previous displayed frame: 0.000758000 seconds] [Time since reference or first frame: 0.273868000 seconds] Frame Number: 29 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm:gsm_a.dtap] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18ba (6330) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23ee [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 1, Channel: SDCCH/8 (3) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 1 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585908 Channel Type: SDCCH/8 (8) Antenna Number: 127 Sub-Slot: 3 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x03 .00. .... = LPD: Normal GSM (0) ...0 00.. = SAPI: RR/MM/CC (0) .... ..1. = C/R: 1 .... ...1 = EA: Final octet (1) Control field: I, N(R)=2, N(S)=2 (0x44) 010. .... = N(R): 2 .... 010. = N(S): 2 .... ...0 = Frame type: Information frame (0x0) Length Field: 0x09 0000 10.. = Length: 2 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) [2 Message fragments (22 bytes): #7(20), #29(2)] [Frame: 7, payload: 0-19 (20 bytes)] [Frame: 29, payload: 20-21 (2 bytes)] [Message fragment count: 2] [Reassembled LAPDm length: 22] GSM A-I/F DTAP - Location Updating Accept Protocol Discriminator: Mobility Management messages (5) .... 0101 = Protocol discriminator: Mobility Management messages (0x5) 0000 .... = Skip Indicator: No indication of selected PLMN (0) 00.. .... = Sequence number: 0 ..00 0010 = DTAP Mobility Management Message Type: Location Updating Accept (0x02) Location Area Identification (LAI) Location Area Identification (LAI) - 410/01/10470 Mobile Country Code (MCC): Pakistan (410) Mobile Network Code (MNC): Mobilink (01) Location Area Code (LAC): 0x28e6 (10470) Mobile Identity - TMSI/P-TMSI (0x462b5dfb) Element ID: 0x17 Length: 5 1111 .... = Unused: 0xf .... 0... = Odd/even indication: Even number of identity digits .... .100 = Mobile Identity Type: TMSI/P-TMSI/M-TMSI (4) TMSI/P-TMSI: 0x462b5dfb PLMN List Equivalent - 2 PLMNs Element ID: 0x4a Length: 6 PLMN[1] Mobile Country Code (MCC): 410 Mobile Network Code (MNC): 01 PLMN[2] Mobile Country Code (MCC): 410 Mobile Network Code (MNC): 07 Frame 30: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.723780000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.723780000 seconds [Time delta from previous captured frame: 0.007217000 seconds] [Time delta from previous displayed frame: 0.007217000 seconds] [Time since reference or first frame: 0.281085000 seconds] Frame Number: 30 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:gsm_a.ccch] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18bb (6331) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23ed [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 0, Channel: CCCH (2) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 0 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -42 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585912 Channel Type: CCCH (2) Antenna Number: 53 Sub-Slot: 2 GSM CCCH - Paging Request Type 2 L2 Pseudo Length 0010 11.. = L2 Pseudo Length value: 11 .... 0110 = Protocol discriminator: Radio Resources Management messages (0x6) .... 0110 = Protocol discriminator: Radio Resources Management messages (0x6) 0000 .... = Skip Indicator: No indication of selected PLMN (0) Message Type: Paging Request Type 2 Page Mode .... 0000 = Page Mode: Normal paging (0) Channel Needed ..11 .... = Channel 1: TCH/H or TCH/F (Dual rate) (3) 11.. .... = Channel 2: TCH/H or TCH/F (Dual rate) (3) TMSI/P-TMSI - Mobile Identity 1 TMSI/P-TMSI TMSI/P-TMSI Value: 0x56310ec1 TMSI/P-TMSI - Mobile Identity 2 TMSI/P-TMSI TMSI/P-TMSI Value: 0x452d9879 P2 Rest Octets L... .... = Channel Needed 3: Not Present .L.. .... = NLN(PCH): Not Present ..L. .... = Priority 1: Not Present ...L .... = Priority 2: Not Present .... L... = Priority 3: Not Present .... .L.. = Packet Paging Procedure 1: For RR connection establishment .... ..L. = Packet Paging Procedure 2: For RR connection establishment .... ...L = Packet Paging Procedure 3: For RR connection establishment L... .... = Additions in release 6: Not Present Padding Bits: default padding Frame 31: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.724162000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.724162000 seconds [Time delta from previous captured frame: 0.000382000 seconds] [Time delta from previous displayed frame: 0.000382000 seconds] [Time since reference or first frame: 0.281467000 seconds] Frame Number: 31 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18bc (6332) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23ec [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 1, Channel: SDCCH/8 (4) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 1 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585912 Channel Type: SDCCH/8 (8) Antenna Number: 19 Sub-Slot: 4 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x01 .00. .... = LPD: Normal GSM (0) ...0 00.. = SAPI: RR/MM/CC (0) .... ..0. = C/R: 0 .... ...1 = EA: Final octet (1) Control field: S, func=RR, N(R)=2 (0x41) 010. .... = N(R): 2 .... 00.. = Supervisory frame type: Receiver ready (0x0) .... ..01 = Frame type: Supervisory frame (0x1) Length Field: 0x01 0000 00.. = Length: 0 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) Frame 32: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.769312000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.769312000 seconds [Time delta from previous captured frame: 0.045150000 seconds] [Time delta from previous displayed frame: 0.045150000 seconds] [Time since reference or first frame: 0.326617000 seconds] Frame Number: 32 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18c4 (6340) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23e4 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 1, Channel: SDCCH/8 (5) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 1 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585916 Channel Type: SDCCH/8 (8) Antenna Number: 127 Sub-Slot: 5 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x01 .00. .... = LPD: Normal GSM (0) ...0 00.. = SAPI: RR/MM/CC (0) .... ..0. = C/R: 0 .... ...1 = EA: Final octet (1) Control field: S, func=RR, N(R)=2 (0x41) 010. .... = N(R): 2 .... 00.. = Supervisory frame type: Receiver ready (0x0) .... ..01 = Frame type: Supervisory frame (0x1) Length Field: 0x01 0000 00.. = Length: 0 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) Frame 33: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.773014000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.773014000 seconds [Time delta from previous captured frame: 0.003702000 seconds] [Time delta from previous displayed frame: 0.003702000 seconds] [Time since reference or first frame: 0.330319000 seconds] Frame Number: 33 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm:data] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18c5 (6341) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23e3 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 0, Channel: SDCCH/4 (0) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 0 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585918 Channel Type: SDCCH/4 (7) Antenna Number: 115 Sub-Slot: 0 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x25 .01. .... = LPD: Cell broadcast service (1) ...0 01.. = SAPI: Unknown (1) .... ..0. = C/R: 0 .... ...1 = EA: Final octet (1) Control field: I, N(R)=0, N(S)=3 (0x06) 000. .... = N(R): 0 .... 011. = N(S): 3 .... ...0 = Frame type: Information frame (0x0) Length Field: 0x21 0010 00.. = Length: 8 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) Data (8 bytes) 0000 30 05 f4 42 30 71 5a 2b 0..B0qZ+ Data: 3005f44230715a2b [Length: 8] Frame 34: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.777537000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.777537000 seconds [Time delta from previous captured frame: 0.004523000 seconds] [Time delta from previous displayed frame: 0.004523000 seconds] [Time since reference or first frame: 0.334842000 seconds] Frame Number: 34 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18c6 (6342) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23e2 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 1, Channel: SDCCH/8 (6) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 1 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585920 Channel Type: SDCCH/8 (8) Antenna Number: 127 Sub-Slot: 6 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x01 .00. .... = LPD: Normal GSM (0) ...0 00.. = SAPI: RR/MM/CC (0) .... ..0. = C/R: 0 .... ...1 = EA: Final octet (1) Control field: S, func=RR, N(R)=2 (0x41) 010. .... = N(R): 2 .... 00.. = Supervisory frame type: Receiver ready (0x0) .... ..01 = Frame type: Supervisory frame (0x1) Length Field: 0x01 0000 00.. = Length: 0 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) Frame 35: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.781016000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.781016000 seconds [Time delta from previous captured frame: 0.003479000 seconds] [Time delta from previous displayed frame: 0.003479000 seconds] [Time since reference or first frame: 0.338321000 seconds] Frame Number: 35 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm:data] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18c7 (6343) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23e1 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 0, Channel: SDCCH/4 (1) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 0 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585922 Channel Type: SDCCH/4 (7) Antenna Number: 228 Sub-Slot: 1 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x25 .01. .... = LPD: Cell broadcast service (1) ...0 01.. = SAPI: Unknown (1) .... ..0. = C/R: 0 .... ...1 = EA: Final octet (1) Control field: I, N(R)=0, N(S)=3 (0x06) 000. .... = N(R): 0 .... 011. = N(S): 3 .... ...0 = Frame type: Information frame (0x0) Length Field: 0x21 0010 00.. = Length: 8 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) Data (8 bytes) 0000 00 05 f4 c3 88 af d0 23 .......# Data: 0005f4c388afd023 [Length: 8] Frame 36: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.786341000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.786341000 seconds [Time delta from previous captured frame: 0.005325000 seconds] [Time delta from previous displayed frame: 0.005325000 seconds] [Time since reference or first frame: 0.343646000 seconds] Frame Number: 36 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18c8 (6344) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23e0 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 1, Channel: SDCCH/8 (7) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 1 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585924 Channel Type: SDCCH/8 (8) Antenna Number: 6 Sub-Slot: 7 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x03 .00. .... = LPD: Normal GSM (0) ...0 00.. = SAPI: RR/MM/CC (0) .... ..1. = C/R: 1 .... ...1 = EA: Final octet (1) Control field: U, func=UI (0x03) 000. 00.. = Command: Unnumbered Information (0x00) .... ..11 = Frame type: Unnumbered frame (0x3) Length Field: 0x01 0000 00.. = Length: 0 .... ..0. = M: Last segment (0) .... ...1 = EL: Final octet (1) Frame 37: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.829084000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.829084000 seconds [Time delta from previous captured frame: 0.042743000 seconds] [Time delta from previous displayed frame: 0.042743000 seconds] [Time since reference or first frame: 0.386389000 seconds] Frame Number: 37 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18d1 (6353) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23d7 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 0, Channel: SDCCH/4 (2) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 0 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585928 Channel Type: SDCCH/4 (7) Antenna Number: 71 Sub-Slot: 2 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x2d .01. .... = LPD: Cell broadcast service (1) ...0 11.. = SAPI: SMS/SS (3) .... ..0. = C/R: 0 .... ...1 = EA: Final octet (1) Control field: I, N(R)=0, N(S)=3 (0x06) 000. .... = N(R): 0 .... 011. = N(S): 3 .... ...0 = Frame type: Information frame (0x0) Length Field: 0x22 0010 00.. = Length: 8 .... ..1. = M: More segments (1) .... ...0 = EL: More octets (0) Frame 38: 81 bytes on wire (648 bits), 81 bytes captured (648 bits) Encapsulation type: Ethernet (1) Arrival Time: Jul 21, 2020 13:59:13.829600000 PKT [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1595321953.829600000 seconds [Time delta from previous captured frame: 0.000516000 seconds] [Time delta from previous displayed frame: 0.000516000 seconds] [Time since reference or first frame: 0.386905000 seconds] Frame Number: 38 Frame Length: 81 bytes (648 bits) Capture Length: 81 bytes (648 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:udp:gsmtap:lapdm:gsm_a.ccch] Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00) Destination: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: 00:00:00_00:00:00 (00:00:00:00:00:00) Address: 00:00:00_00:00:00 (00:00:00:00:00:00) .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 67 Identification: 0x18d2 (6354) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 64 Protocol: UDP (17) Header checksum: 0x23d6 [validation disabled] [Header checksum status: Unverified] Source: 127.0.0.1 Destination: 127.0.0.1 User Datagram Protocol, Src Port: 56659, Dst Port: 4729 Source Port: 56659 Destination Port: 4729 Length: 47 Checksum: 0xfe42 [unverified] [Checksum Status: Unverified] [Stream index: 0] GSM TAP Header, ARFCN: 117 (Downlink), TS: 1, Channel: SACCH/8 (0) Version: 2 Header Length: 16 bytes Payload Type: GSM Um (MS<->BTS) (1) Time Slot: 1 ..00 0000 0111 0101 = ARFCN: 117 .0.. .... .... .... = Uplink: 0 Signal Level (dBm): -41 Signal/Noise Ratio (dB): 0 GSM Frame Number: 1585928 Channel Type: SACCH/8 (136) Antenna Number: 109 Sub-Slot: 0 SACCH L1 Header, Power Level: 5, Timing Advance: 2 ...0 0101 = MS power level: 5 .... .1.. = FPC: In use Actual Timing Advance: 2 Link Access Procedure, Channel Dm (LAPDm) Address Field: 0x03 .00. .... = LPD: Normal GSM (0) ...0 00.. = SAPI: RR/MM/CC (0) .... ..1. = C/R: 1 .... ...1 = EA: Final octet (1) Control field: U, func=UI (0x03) 000. 00.. = Command: Unnumbered Information (0x00) .... ..11 = Frame type: Unnumbered frame (0x3) GSM CCCH - System Information Type 5 L2 Pseudo Length 0100 10.. = L2 Pseudo Length value: 18 .... 0110 = Protocol discriminator: Radio Resources Management messages (0x6) .... 0110 = Protocol discriminator: Radio Resources Management messages (0x6) 0000 .... = Skip Indicator: No indication of selected PLMN (0) Message Type: System Information Type 5 Neighbour Cell Description - BCCH Frequency List ..0. .... = EXT-IND: The information element carries the complete BA (0) ...0 .... = BA-IND: 0 00.. 101. = Format Identifier: Unknown (0x05) List of ARFCNs = 124 122 121 120 118 117 116 115 112 111 102 73 71 63 62 58 56 55 54 53 23 22 18 15 6 4 2I want to print the List of ARFCNs which is available numerous times in the text. I've used searchfile = open("grub.txt", "r") for line in searchfile: if "List" in line: print(line) searchfile.close()But this prints all the instances where the list of ARFCNs come. How can I modify the code so that it prints the list only the first time it appears in text and also counts the number of entries in the list? RE: Print a certain string only the first time it appears in a test file - bowlofred - Jul-22-2020 (Jul-22-2020, 05:31 AM)buttercup Wrote: I want to print the List of ARFCNs which is available numerous times in the text. I find it odd that you pasted such a large text segment, but I only see one line with "List of ARFCNs", so when I run your program, I don't really see the problem. Quote:How can I modify the code so that it prints the list only the first time it appears in text Once you find the match you want, break out of the loop.Quote: and also counts the number of entries in the list? Split the line on =, then for the second part, split it into a list on spaces. You can then keep the entries around and count them with len()
RE: Print a certain string only the first time it appears in a test file - buttercup - Jul-22-2020 (Jul-22-2020, 06:45 AM)bowlofred Wrote:(Jul-22-2020, 05:31 AM)buttercup Wrote: I want to print the List of ARFCNs which is available numerous times in the text. Im sorry can you give an example on how should I proceed? RE: Print a certain string only the first time it appears in a test file - palladium - Jul-22-2020 Looks like a good case for a generator. def count(f): for line in f: if 'List' in line: yield line.replace('\n','') with open('grub.txt') as f: lst = [i for i in count(f)] print(len(lst)) #gets length of list or number of instances z = iter(lst) a = 0 while a <= 1: #you can change the count here if you want to print more than one iteration try: print(next(z)) a +=1 except StopIteration: print('end') breakNote, the above code and your code will print out all lines with the chars "List" in it. Last I check there were a few lines with "List" in it, but as bowlofred pointed out, there appears to be only one line that you are really after. RE: Print a certain string only the first time it appears in a test file - buttercup - Jul-22-2020 (Jul-22-2020, 09:48 AM)palladium Wrote: Looks like a good case for a generator.Thanks alot. The code works like magic except that it prints out two iterations instead of one :/ RE: Print a certain string only the first time it appears in a test file - palladium - Jul-23-2020 Oops. Line 12 has an error, should read: while a < 1:If you read up on iterators and generators, it should be easy for you to spot this. |