Hi all,
I am trying to do a simple program to keep some information on components. The user is asked to input the components name, description, new or used, and price bought. A component number is given automatically by the program, where with each number the code CMP is added (ex: for components 1: CMP1).
Now my problem is to sort the components by their name. I did come research and found that merge or quick sort are the best methods to use. I did found some tutorials by they only sort individual characters or numbers.
How can I use these sorting methods when you have a text file (.txt) full of information? How will the program know which are the components numbers? and how will the program know which information must be shifted with the respective component number?
Any help would be highly appreciated.
I am trying to do a simple program to keep some information on components. The user is asked to input the components name, description, new or used, and price bought. A component number is given automatically by the program, where with each number the code CMP is added (ex: for components 1: CMP1).
Now my problem is to sort the components by their name. I did come research and found that merge or quick sort are the best methods to use. I did found some tutorials by they only sort individual characters or numbers.
How can I use these sorting methods when you have a text file (.txt) full of information? How will the program know which are the components numbers? and how will the program know which information must be shifted with the respective component number?
Any help would be highly appreciated.