Thank you for your suggesstion but it didnt work and I apologize for not being more cleared. Let me try one more time to see if you can understand.
KEY(Pos 1-8) %AMOUNT (Pos 10-16)
TABLE1 88.92 -> First highest value for TABLE1, but this is second highest value of all records.
TABLE2 87.00 -> First highest value for TABLE2, but this is the third highest value of all records.
TABLE3 85.59 -> First highest value for TABLE3
TABLE4 85.00 -> First highest value for TABLE4
TABLE6 90.00 -> First highest value for TABLE6, but this is the first highest value of all records.
The output file should have TABLE6 first because 90.00 is the highest % of all the records. And if there are more records for the same TABLE6 it should be followed. In the above example there is only one TABLE6. This completes the first highest % row written and all the records associated for that TABLE6. The next highest will be for TABLE1 88.92 and all the records for TABLE1 should be sorted in the descending order of the % and so on for other tables also. I know its little complicated but my final output should be first sorted based on % value in descending order and write all the records for that associated table and go on. Let me know if this helps.
Those are two different goals:
1) get one single line with the highest numeric value (whatever the value means)
2) re-order all rows of the table in the required order
It is just senseless idea to mix those two different goals, different methods, different results, and different statements into one single task/code/resulting table.
They are two completely separate tasks, and two completely different output results
Try to perform those two tasks separately, and do not mix them into one messy task.
THEY ARE COMPLETELY DIFFERENT, do have nothing in common (except the same input data)
Again, as in >90% of all the questions at this forum, the issue is not a specific programming tool, or any language syntax, or an internal function, but just inability of abstract logical thinking in general, and lack of experience in algorithm design
Thanks, it is okay for people to think and try to come up to achieve solutions in a single step. Atleast I tried and that is why I requested help to see if there were any feasible solution. Thank you for reviewing and trying though.
Joerg, Thank you for your response. I am out of office next week. But I will try your code as soon as I come back and will respond.
Thank you for taking time to help me achieve with the solution although it is in two steps.