I have a text file that I am trying to parse through:
176.9.x.xx - MISS [07/Aug/2017:13:03:59 -0400] foo.org "GET /foo/bar?page=7 HTTP/1.1" 200 17441 "-" "Mozilla/5.0 (compatible; MegaIndex.ru/2.0; +http://megaindex.com/crawler)" u:192.168.x.x:80 t:0.002
I am really trying to sort by the value
t:0.002. ( Not all the values are 0.002, but I am trying to sort this field numerically). Now in a bunch of these entries, I get "t:-" (which I am using the grep -v to ignore).
I know i can use sort but this is where I get stuck:
cat test.txt | grep -v "t:-" | sort -n
I can't seem to get it to sort by the value "t:". I'm sure I need to add a few more things to the sort command but I'm not sure what. Any suggestions?