ocramas
1
Hi guys,
I have been trying to do this, but... no luck so maybe you can help me.
I have a line like this:
Total Handled, Received, on queue Input Mgs: 140 / 14 => 0
I need to, get the number after the / until the =, to get only 14 .
Any help is greatly appreciated.
Thanks,
May be like this:
awk -F/ '/Total Handled/{print $2+0}' file
ocramas
3
hmm, that one it is just returning 0.
Yoda
4
elixir_sinari's solution should work.
You can also try using:
awk '/Total Handled/ { for(i=0;i<NF;i++) if($i=="/") print $(i+1); } ' infile
ocramas
5
Thanks guys, this last one works like a charm.