I'm trying
:%s/,/\n/g
but it inserts what looks like a ^@ instead of an actual newline, the file is not on DOS mode or anything.
What should I do?
EDIT: If you are curious, like me, check this other question as well.
I'm trying
:%s/,/\n/g
but it inserts what looks like a ^@ instead of an actual newline, the file is not on DOS mode or anything.
What should I do?
EDIT: If you are curious, like me, check this other question as well.
You need to use :%s/,/^M/g To get the ^M character, press Ctrl+V followed by ENTER
Here's the trick: First, set your vi(m) session to allow pattern matching with special characters (ie: newline). It's probably worth putting this line in your .vimrc or .exrc file.
:set magic
Next, do:
:s/,/,^M/g
To get the ^M character, type ctrl-v and hit enter. Under Windows, do ctrl-q enter. The only way I can remember these is by remembering how little sense they make:
"What would be the worst control-character to use to represent a newline?"
"Either 'q' ( because it usually means "Quit") or 'v' because it would be so easy to type ctrl-c by mistake and kill the editor."
"Make it so."