Reputation: 4194
I have a pipe(|) separated file, but there some "\|" which messed up for further processing. How can I substitute "\|" into " |"(space pipe)?
I tried :/\/|
in vi, it can find " \|" but I tried %s//\//|/ //|/g
it is not working. Is there anyway I can do it?
Upvotes: 1
Views: 121
Reputation: 262939
You can issue the following command:
:1,$s/\\|/ |/g
Upvotes: 2
Reputation: 195059
in vim, try:
%s/\\|/ |/g
it will change
aa\|bb|cc
into
aa |bb|cc
or using sed
:
sed -i 's/\\|/ |/g' file
Upvotes: 2