Replacing multiple occurrences of a word using sed in unix
<p>I have a requirement in unix to replace an occurrence of word with a space.
My File looks something like below. I need to replace |NA| with a space</p>

<p>File Format</p>

<pre><code>1234|NA|NA|abcd|xyz
2345|NA|NA|NA|lmn
456|NA|abcd|xya|ggh
</code></pre>

<p>Expected Output</p>

<pre><code>1234| | |abcd|xyz
2345| | | |lmn
456| |abcd|xya|ggh
</code></pre>

<p>I am using the following command but it only replaces the very first occurrence</p>

<pre><code>sed 's/|NA|| |/g'
</code></pre>