singe batteur singe batteur - 1 year ago 114
YAML Question

how to invert keys and values in a YAML file (key : value)

I have a big

translation file, in which I would like to invert the keys and the values.

what I have :

some english sentence : une phrase en francais
another one : une autre

what I would like to get :

une phrase en francais : some english sentence
une autre : another one

I'm sure there might be a bunch of easy regex to do so, but I could not figure out how to do this ...

I dont search a script, just a regex

Answer Source

The regex:


The substitution:

$2 : $1


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download