Question: I have a dict of following format:

```
 d[1][2]= 0.3
 d[1][3] = 0.4
 d[2][8] = 0.2
 d[id1][id2] = value

```

I want to reverse sort this by value?

My logic is very verbose and I have a feeling that it can be done very quickly in python?

Answer: 
Replace `\r` by `""\r`, using extended search mode (you may use `\n` instead of `\r` if your file is in UNIX mode).

To add it on a new line after every line, you can replace `\r\n` by `\r\n""\r\n` (or once again `\n` by `\n""\n` depending on your line ending).
Another way, you can try the plugin ConyEdit. Use its command line `cc.aal <yourContent>` to append after lines with your content. By the way, it can append different text to each line(push data to an array first, then use the array).