mIRC Home    About    Download    Register    News    Help

Print Thread
D
defiant
defiant
D
Hi,

As topic: I have a file called guilds.ini
The next is a snap from it
Code:
 
[Guilds]
Hallucinogen=Hallucinogen'3751802'29
Kickers=Kickers'1167914'2
Fatality=Fatality'1330298'196
Crystal=crystal'2953024'37
SpiriT=SpiriT'10615227'81
Musketeers=Musketeers'2034137'13
 


Now i'd like to sort it by the 2nd ' token (39).. highest number on top, lowest down. This can be in the same file or in a new file, thats no problem (Please mind that there are about 50 more lines with guilds). Is that possible to do? I've tried and tried.. but nothing worked :F So, if anyone could please help me out here smile

S
Sigh
Sigh
S
Here's a simple method involving loading the section into a window, sorting it, then writing it back:

Code:
alias sortguilds {
  window -h @gtmp
  loadbuf -rtguilds @gtmp guilds.ini
  remini guilds.ini Guilds
  filter -cwwteu 2 39 @gtmp @gtmp
  write guilds.ini [Guilds]
  savebuf -a @gtmp guilds.ini
  window -c @gtmp
}

D
defiant
defiant
D
Thanks wink exactly what i needed smile


Link Copied to Clipboard