I have a file which has contents like so:
size is X1 Identifier is Y1
size is X1 Identifier is Y1
size is X1 Identifier is Y1
I want to re-arrage the file so that I get
Identifier is Y1 size is X1
Identifier is Y1 size is X1
Identifier is Y1 size is X1
How do I do this using vim find & replace? Or any other function in vim?
Use capturing groups and switch both groups
%s/\v(.*) (I.*)/\2 \1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With