Hey guys , im having a problem in starting a project. Basically , i am suppose read from a file(Data.txt) and then display the information in that file in a new format.

Data.txt
HIstory M123
Maths M103
Science M111
English M105

As the results needs to be displayed based on the subjects with the lowest subject code , in this case Maths, how do i go about doing it? I was thinking it of storing it into an array , but the problem is, how do i read the value out of it in the first place and comparing it to the rest of the subject code to check which one is the lowest and then displaying it first followed by the rest?

Expected output :

Maths M103
English M105
Science M111
HIstory M123


A clue about the type of methods i should be looking at will help alot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.