+2 votes
in Programming Languages by (11.3k points)
I have a file with some records. I want to sort its records. How can I do that?

1 Answer

0 votes
by (11.3k points)
edited by

1. use hGetContents to read the records of the given file.

2. Then use this function 'unlines (sort(lines inline))' to sort the records the file where inline = hGetContents filehandle

...