C
C#12mo ago
Ewan

✅ How do i order these lines from highest to lowest from a text file

From this text file, there are 5 lines. I want to order these people and output the order from highest to lowest from their capstone mark, how do i do this?
No description
7 Replies
Ewan
EwanOP12mo ago
i can use either .split() or .substring() to get the mark out but how do i order these from highest to lowest whilst also keeping their names in it too?
Jimmacle
Jimmacle12mo ago
i would create a class (in this case multiple) to represent the data in each line and parse the lines into a list of those classes, that makes working with the data in C# significantly easier unfortunately for you that doesn't look like any common serialization format i know of
SG97
SG9712mo ago
which is kinda odd, as it resembles json
hime
hime12mo ago
Are you the one who generated this text?
Ewan
EwanOP12mo ago
@Jimmacle @sn0wgirl_97 @hime oh no this is just lines in a text file
hime
hime12mo ago
I mean, are you the one who write the text file
Ewan
EwanOP12mo ago
oh no these are pre written
Want results from more Discord servers?
Add your server