No.,Name,ID card,Pin code,Deposit,Date
1,Bilal Khan,1111111111111,1122,100,11-10-2020
2,Ali Ahmed,2222222222222,6677,100,11-10-2020
3,Bilal Khan,1111111111111,1122,50,11-10-2020
4,John,3333333333333,1122,50,11-10-2020
5,Bilal Khan,1111111111111,1122,70,11-10-2020
6,Ali Ahmed,2222222222222,6677,250,11-10-2020
**Required output**
No.,Name,ID card,Pin code,Deposit,Date
1,Bilal Khan,1111111111111,1122,100,11-10-2020
5,Bilal Khan,1111111111111,1122,70,11-10-2020
3,Bilal Khan,1111111111111,1122,50,11-10-2020
2,Ali Ahmed,2222222222222,6677,100,11-10-2020
6,Ali Ahmed,2222222222222,6677,250,11-10-2020
4,John,3333333333333,1122,50,11-10-2020
What I have tried:
I write data to the CSV file in C. The data are written in a random way but I want to arrange them. I don't want to be specific about them that to arrange this account first or that account second
but I just want to arrange the data of one account *like* number one, three, and five are the same accounts but they are not arranged. Same with number two and six. They are the same accounts but not arranged and combined. So how to do this in C?