Write a scritp to parse output of sort program