11-15-2012
1,
0
Join Date: Nov 2012
Last Activity: 15 November 2012, 12:22 PM EST
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
What is the way to get a total count of students and with highest marks from a file?
I have different things that I was trying to do but am kind of struggling with this since I'm a Linux noob. I have a files with student names ,marks,year school the . What is the most efficient way to get a total count of students and student with highest marks
Initially I tried to get a count and pipe it out, but was at a loss as to how to get a count of the students only enrolled in one class, but this is where I am at now.
School.txt
name,marks,year,school
abhi,95,2001,pda
ram,96,2002,nv
raghu,97,2003,noble
prasanna,85,2004,sbr
pras,85,2004,sbr
ravi,86,2006,sbr
sanju,75,2009,sbr
abhilash,60,2000,sbr
prashant,99,2010,hgus
geeta,97,2011,klms
1. print total number of schools
cut -d"," -f4 ram.txt |sort |uniq | grep -v "School" | wc -l
2. print the senior most student name and junior most student name