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: 
You can do so by hitting Cntrl+F and then checking regular expression box.And put what you want to replace with what thing. You can put regular expression to find as

```
    \r 

```

and replace it with

```
        "YOUR TEXT"\r

```

![enter image description here](https://i.stack.imgur.com/n6H3k.png)
The chosen answer didn't work for me on notepad++ on windows, it simply appended the text at the end of the line. Here's what worked:

1. Open search and replace box, in 'find what' field add '$' (meaning the end of line char)
2. In 'replace with' field use, \r - this will add text after each line
3. Click on replace All button to insert the new line.

![Check the screenshot of the above steps](https://i.stack.imgur.com/HKhGz.png)