As input data I have a file containing 100 lines. On each line I have a number followed by dot. I need to print into another file the sorted numbers increasingly.
I know reading from a file and printing into a file with see and tell but when it comes to going through all of them from 1 to 100, without doing a read(X),read(Y) etc. for each line in the see() I am lost. So how would you approach this problem?
Please note that this description it’s far more verbose than the actual code required.
I.e. (using Edinburgh-style I/O) see the input file, keep reading, storing in a list til the input =
end_of_file(then close the list), after that use msort to order the list, then tell the output file, and with a loop write each element of the list. You can check if actually there are 100 numbers using length/2.edit untested code to read a list from current input