Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to get awk to read just part of a line 1

Status
Not open for further replies.

danclark

IS-IT--Management
Apr 9, 2001
46
NZ
This may sound rather dumb, but I am trying to just get awk to list whats after 'x word' until 'y word'...

eg...
[1055803211] SERVICE;
I want it to tell me what comes after HTTP but stop after the next ';'

HTTP;OK is all I need (or just OK)

I tried using the character number in the line but the first [1055803211] part keeps changing size.
 
match($0, /HTTP *;/) {
print substr($0,RSTART+RLENGTH, index(substr($0, RSTART+RLENGTH),";")-1)
}



vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top