And before I go posting away about my code, I was wondering if there is actually someone here who knows programming on python and is willing to help. Long story short, I am trying to write a code which reads a file and then sorts and and then writes it out to another file. I am give more details after if there is someone who is willing to help.
Thanks a lot in advance!
Comments
To start off, your program can be divided into a few steps, such as:
i) read all the lines from the input file into a list of strings
ii) sort the list using a simple one-line library function or in-built sort operator, as the case may be for Python
iii) after you have sorted the file, you write out the sorted list to the new file.
Apart from that, you also have to open the relevant files before reading and writing to them, and then close their handles after you are done with them.
The above comment assumes you want to sort the file according to lines.