Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- 2.
- BEGIN { FS="[ :,]"
- max = -1
- i = 0 }{
- while(getline == 1){
- sum = $2 + $3
- if(sum == max){
- b=$1 $3 ":" $2
- tab[i] = b
- i = i+ 1
- }
- else if(sum > max ){
- max = sum
- b=$1 $2 ":" $3
- i = 0
- split("", tab)
- tab[i] = b
- i = i + 1
- }
- }
- for( x in tab){
- print tab[x]
- }}
- 3.
- BEGIN { FS="[,]"
- sum = 0
- }
- {
- while(getline == 1){
- sum = sum + $2
- }
- print sum
- }
- 4.
- BEGIN { FS="[,]"
- max = 0
- count = 0
- sum = 0
- }{
- if(count == 4){
- print max
- count = 0
- }
- if(count < 4){
- if( max < $2 ){
- max = $2
- details = $1 ", " $2
- }
- count = count + 1
- }
- }
- 5.
- 6.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement