1832595 Members
3058 Online
110043 Solutions
New Discussion

script need for the data

 
jack Hu_1
Advisor

script need for the data

Dear Admins:
I have a data file ( collect disk data from glance).
It will show me two times of the disk report.
But I only want the last one.( different from the time )
And also want the whole line of the bigger two value of the record from the unti field.

Can someone give me some suggestion ?
thanks
Jack Hu
3 REPLIES 3
Steve Steel
Honored Contributor

Re: script need for the data

Hi

nl -ba file|grep "\-\-\-"|tail -n 1|cut -c1-6|
while read a rest
do
tail +$a file
done

Will give the second one


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Steve Steel
Honored Contributor

Re: script need for the data

Hi

For the high values

sort -k 5,5 file|grep -v "\-\-\-"|
while read line
do
read line1
echo "$line1"
done



Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Tim Adamson_1
Honored Contributor

Re: script need for the data

Started to answer this question, saw Steve's 2nd answer, liked it and decided to sit on the fence. Best decision I ever made and if it doesn't work, blame Steve. :p
Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.