I got a file called Album in that there is list of songs i want to find the Longest and shortest song name in field 2 ie ($2)....
Please help me with "awk"
What have you tried? This sounds like homework.
nawk '{
if(NR==1){
max=min=$2
}
else{
l=length($2)
max=(l>length(max))?$2:max
min=(l<length(min))?$2:min
}
}
END{
print max
print min
}' filename