0

Please help, i have been studying sed, awk, grep command for long time now i could not figure out how to solve this problem. I have a log file in unix, i was to print start from a given regular expression until another expression. FOr example

<!--##
[USERID | 2019-10-25 13:07:39,399 | SIBJMSRAThreadPool : 4 | Android-Transactionname-1572023259140 | -]
Request On
Accept: text/xml
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/xml
User-Agent: NNOS-CCF
Connection: keep-alive
Content-Length: 1792

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"
>
<wsse:UsernameToken>
<wsse:Username></wsse:Username>
<wsse:Password></wsse:Password>
</wsse:UsernameToken>

##-->

<!--##
[USERID | 2019-10-25 13:07:41,264 | SIBJMSRAThreadPool : 2 | Android-Transactionname-1572023260299 | -]
Request On
Accept: application/json
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json
Connection: keep-alive
Content-Length: 327

I want to just output text starting from Android-Transactionname-1572023259140 to ##-->

Abdus Samad
  • 343
  • 2
  • 12
  • 27
  • read this: https://stackoverflow.com/questions/38972736/how-to-print-lines-between-two-patterns-inclusive-or-exclusive-in-sed-awk-or – P.... Oct 25 '19 at 21:14
  • thanks to @P... this link answers my question https://stackoverflow.com/questions/38972736/how-to-print-lines-between-two-patterns-inclusive-or-exclusive-in-sed-awk-or – Abdus Samad Oct 25 '19 at 21:21

1 Answers1

-1

If you want to be line-oriented:

awk '/Android-Transactionname-1572023259140/,/\#\#-->/' 
Jé Queue
  • 10,359
  • 13
  • 53
  • 61