tr *translates* characters. So, in your example, each and every space becomes a pipe. You want a substitution, s/\s+/\|/. This says take each group of spaces (\s+) and replace them with a single pipe (\|). tr/ /\|/ says take each space *as an individual* and replace it with a pipe.
scott
In reply to Re: Reaplcing double spaces
by scott
in thread Replacing double spaces (was: Reaplcing double spaces)
by DaWolf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |