How to shift lines down in vi

Assuming i have ^ delimited files like this: (note ^M is getting from ctrl+ v plus "enter", while "^" is just shift+6)

1^2^3^M1^2^3^M1^2^3^M

Is there any quick way to make the file into the following?

1^2^3
1^2^3
1^2^3

Thanks!

1 answer

  • answered 2018-02-13 00:32 Chubaka

    Find an answer!

    %s/^M/\r/g
    

    ^M is obtained from ctrl+ v plus "enter"