Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Averages-Mode/Vedit-macro-language/averages-mode.vedit
Normal file
25
Task/Averages-Mode/Vedit-macro-language/averages-mode.vedit
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
BOF // Copy all data to a new buffer
|
||||
Reg_Copy(10, ALL)
|
||||
Buf_Switch(Buf_Free)
|
||||
Reg_Ins(10)
|
||||
|
||||
Sort(0, File_Size) // Sort the data
|
||||
|
||||
BOF
|
||||
repeat(ALL) { // Count & delete duplicate lines
|
||||
#1 = 1
|
||||
while(Match("^{.*}\N\1$", REGEXP)==0) {
|
||||
Del_Line(1)
|
||||
#1++
|
||||
}
|
||||
Num_Ins(#1, NOCR) // Insert item count at the beginning of line
|
||||
Ins_Char(9) // TAB
|
||||
Line(1, ERRBREAK) // Next (different) line
|
||||
}
|
||||
|
||||
Sort(0, File_Size, REVERSE) // Sort according to the count
|
||||
|
||||
BOF // Display the results
|
||||
Reg_Copy_Block(10, CP, EOL_pos)
|
||||
Buf_Quit(OK)
|
||||
Statline_Message(@10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue