I have to replace all occurrences of the vertical bar character
| with a comma
, when they appear between
on each line of a file.
Let's say I have the below string in the file:
wah wah| [go great|no great|so great] | wah wah | [go great|no great|so great]
I want my output to be like below:
wah wah| [go great,no great,so great] | wah wah | [go great,no great,so great]
Note that there can be multiple
Vertical bars between the first
] and the second
[ should not be changed.
How I can achieve this using shell commands? I tried several ways like below, but nothing worked.
sed '/[/,/]/s/|/,/g' abcd.csv