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

1 Answer

+2 votes
by (71.8k points)
selected by
 
Best answer

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


...