Mar 26, 2004 #1 TheDash MIS Mar 25, 2004 171 US Hi, Can we skip first line during processing? for example: the first line shows header info. Ex: bdf -i | awk {'print $5'} gives %used where as it should start with next line so that it will give 11% ... Thanks
Hi, Can we skip first line during processing? for example: the first line shows header info. Ex: bdf -i | awk {'print $5'} gives %used where as it should start with next line so that it will give 11% ... Thanks
Mar 26, 2004 #2 vgersh99 Programmer Jul 27, 2000 2,146 US bdf -i | awk 'NF > 1 {print $5}' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
bdf -i | awk 'NF > 1 {print $5}' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Mar 26, 2004 #3 vgersh99 Programmer Jul 27, 2000 2,146 US ooops, sorry: bdf -i | awk 'FNR > 1 {print $5}' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
ooops, sorry: bdf -i | awk 'FNR > 1 {print $5}' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Mar 26, 2004 #4 johngiggs Technical User Oct 30, 2002 492 US TheDash, Try using: bdf | awk '!/^[A-z]/{print $5}' John Upvote 0 Downvote
Mar 26, 2004 Thread starter #5 TheDash MIS Mar 25, 2004 171 US Thanks all for the immediate help. I also need to trim down 11% to 11? Can somebody please tell how I can substring $var? Unfortunately, I don't see substr help anywhere. Upvote 0 Downvote
Thanks all for the immediate help. I also need to trim down 11% to 11? Can somebody please tell how I can substring $var? Unfortunately, I don't see substr help anywhere.
Mar 26, 2004 #6 PHV MIS Nov 8, 2002 53,708 FR Have you tried this ? bdf -i | awk 'FNR > 1 {sub(/%/,"",$5);print $5}' Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 Upvote 0 Downvote
Have you tried this ? bdf -i | awk 'FNR > 1 {sub(/%/,"",$5);print $5}' Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
Mar 26, 2004 #7 vgersh99 Programmer Jul 27, 2000 2,146 US bdf -i | awk 'FNR > 1 {print $5+0}' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
bdf -i | awk 'FNR > 1 {print $5+0}' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+