Quantcast
Viewing latest article 11
Browse Latest Browse All 157

How can I use regex to match the contents by using expect?

I am new to expect for using the regular expression. trying to parse below input stream. How it can be parse with regexp. As CNTXID is incremental.

"Data"                  CNTXID = 1                      AP = 99                     DEF = FALSE                  CNTXID = 2                      AP = 88                     DEF = TRUE                  CNTXID = 3                      AP = 77                     DEF = FALSE

and CNTXID is not fix.

Required Output

CNTXID_1 = 1    AP_1 = 99   DEF_1 = FALSECNTXID_2 = 2    AP_2 = 88   DEF_2 = TRUECNTXID_3 = 3    AP_3 = 77   DEF_3 = FALSE

Viewing latest article 11
Browse Latest Browse All 157

Trending Articles