Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 158

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

$
0
0

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 all articles
Browse latest Browse all 158

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>