I have a file of ATM Electronic Journal which contains logs of all activities performed on ATM. Now I want to extract the transaction logs highlighted in BOLD Text through Regex.
DATE: 26/07/22 TIME: 17:42:24
ATM ID: 9074
STAN: 886373 RRN: 220717886373
PAN: 621657*******089
TXN: INVALID TRAN SEQ: 0915
STATUS: CUST NOT FOUND
17:42:28 OPCODE = FACF A
17:42:38 OPCODE = FAA DA
17:42:47 NOTES STACKED
17:42:50 CARD TAKEN
17:42:54 NOTES PRESENTED 2,3,1,9
**DATE: 26/07/22 TIME: 17:42:37
ATM ID: 9074
STAN: 887059 RRN: 220717887059
PAN: 621657*******089
A/C: 0622******3203 20586
TXN: WITHDRAWAL SEQ: 0917
AMOUNT: 50000.00
C1 [2], C2 [3], C3 [1], C4 [9]
STATUS: APPROVED
CASH TOTAL TYPE1 TYPE2 TYPE3 TYPE4
DISPENSED 00262 00270 00118 00180
REJECTED 00010 00013 00008 00009
REMAINING 01338 01730 01882 00320
17:42:55 NOTES TAKEN
17:43:04 TRANSACTION END**
*444*26/07/2022*17:43*
*TRANSACTION STARTED*
CARD INSERTED
17:43:15 OPCODE = CAD
CodePudding user response:
This regex should match your bold text:
(DATE\:). (TRANSACTION END)
It checks for text which is in between "DATE:" and "TRANSACTION END"