Sort entries based on date
Sort some entries in a Ledger-file based on date.
Start file
10.09.2011 Description
Some
Stuff
15.09.2011 * Anything really
Random
Stuff
12.10.2011 Nice
Not
Kidding
12.09.2011 Whatever
Anything
Can
Be
Here
14.09.2011 Cool
But
It's always
Indented
13.09.2011 Testing
Always
2 spaces
End file
10.09.2011 Description
Some
Stuff
12.09.2011 Whatever
Anything
Can
Be
Here
13.09.2011 Testing
Always
2 spaces
14.09.2011 Cool
But
It's always
Indented
15.09.2011 * Anything really
Random
Stuff
12.10.2011 Nice
Not
Kidding
View Diff
5,12d4
< 15.09.2011 * Anything really
< Random
< Stuff
<
< 12.10.2011 Nice
< Not
< Kidding
<
18a11,14
> 13.09.2011 Testing
> Always
> 2 spaces
>
24,26c20,26
< 13.09.2011 Testing
< Always
< 2 spaces
---
> 15.09.2011 * Anything really
> Random
> Stuff
>
> 12.10.2011 Nice
> Not
> Kidding
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 116 remaining solutions by signing in and submitting your own entry
#117 ajh / @AlexJHammel - Score: 80 - 12/24/12 @ 19:58
:%s/\v(\d+)\.(\d+)\.(\d+)/\3.2<BS>\2.\1<CR>:%s/\(..*\)\n/\1;/<CR>:sor<CR>:%s/;/\r/g<CR>:<Up><Up><Up><Up><CR>ZZ
0 comments