hi, i don't know c++ syntax, but theoretically, you can explode the file into rows, then split them by space, and then use some sorting algorithm (for example insert sort) to sort them... fig c++ commands is 5 minute work with google...