You cannot sort, if you know only one value at a time. You have to store all the values first, and then sort.
Your values are records that each contain four fields. You should use a struct to store one record. Then you can provide functions that take two records and return true if they are in "correct order". The logic of the function dictates which field is most important.
The first thing to do is to read the data from the file in the required format. The file appears to use the tab character to separate the fields, so you can use getline() with '\t' as the delimiter, apart from the final field on each line, where the delimiter will be '\n'. http://www.cplusplus.com/reference/string/string/getline/