I hope I am putting this in the area.
I am running FreeBSD 10.3 x86_64 ZFS with fully encrypted HDD.
I want to put a CR-LF after every uppercase Q followed by a number, i.e. Q4, Q75, Q453,
In vim, I have tried:
As well as several variations.
Vim will never find
In sed I have tried:
But instead of a CR-LF, I am getting a literal "r".
I have already worked around the problem. I did this substitution in vim:
Then I loaded the file into pluma, and replaced ZZZZZ with '\n'. Still I would like to know why escape characters are not working in vim or sed. Am I doing something wrong? Or is there something wrong with my system?
I am running FreeBSD 10.3 x86_64 ZFS with fully encrypted HDD.
I want to put a CR-LF after every uppercase Q followed by a number, i.e. Q4, Q75, Q453,
In vim, I have tried:
:%s/Q[0-9]+/&\r/g
As well as several variations.
:%s/Q\d\d\d/&\r/g
Vim will never find
\d
.In sed I have tried:
$ cat file.txt | sed -r 's/Q[0-9]+/&\r/'
But instead of a CR-LF, I am getting a literal "r".
I have already worked around the problem. I did this substitution in vim:
:%s/Q[0-9]+/&ZZZZZ/g
Then I loaded the file into pluma, and replaced ZZZZZ with '\n'. Still I would like to know why escape characters are not working in vim or sed. Am I doing something wrong? Or is there something wrong with my system?