Given the following dataset:
Run 1 Run 2 Run 3 Run 4 Run 5
1.991 1.871 1.885 2.007 2.114
2.009 2.211 2.199 2.281 2.094
2.018 2.091 2.115 2.241 2.020
2.782 2.105 2.506 2.660 2.273
1.501 1.885 1.921 1.235 1.873
…and the following series of Vim commands:
gg qq j0 :s/⎵/⎵+⎵/g y$ A ⎵=⎵ <C-r>= (<C-r>")/5⏎ <Esc> q @q @@ @@ @@ :2,6sort /[=]/⏎
gg
: Jump to the top of the fileqq
: Begin recording a macro into registerq
j0
: Drop down a line and back to its first character:s/⎵/⎵+⎵/g
: Substitute every space on the current line for a plus signy$
: Yank (copy) from the beginning of the line to the endA
: Append text onto the end of the current line⎵=⎵
: Type an = sign with a space either side<C-r>=
: Enter the expression resgister (calculator)(<C-r>")/5⏎
: Put the contents of the pasteboard inside of(<pasteboard>)/5
and run it<Esc>
: Leave insert modeq
: Stop recording macro@q
: Run macro q on the next line@@
: Run the last macro (i.e. q) again@@
: Run the last macro (i.e. q) again@@
: Run the last macro (i.e. q) again:2,6sort /[=]/⏎
: Sort lines 2–6 based on the value that appears after the = sign
That will leave you looking at this:
Run 1 Run 2 Run 3 Run 4 Run 5
1.501 + 1.885 + 1.921 + 1.235 + 1.873 = 1.683
1.991 + 1.871 + 1.885 + 2.007 + 2.114 = 1.9736
2.018 + 2.091 + 2.115 + 2.241 + 2.020 = 2.097
2.009 + 2.211 + 2.199 + 2.281 + 2.094 = 2.1588
2.782 + 2.105 + 2.506 + 2.660 + 2.273 = 2.4652