I have the following use case, my file contents look like this
a
b
c
I want a regular expression to do this
a|
b|
c|
Can you recommend a regex in vim?
I have the following use case, my file contents look like this
a
b
c
I want a regular expression to do this
a|
b|
c|
Can you recommend a regex in vim?
This will work for basic scripting purposes
sed 's/$/|/' filename
for vim
:%s/$/|/g
the g is for global, but not needed
Type the following in VIM
:%s/$/|/
This means replace the end of line represented by $
with the string |
.