in reply to how to remove empty pipe delimiters in a line which doesn't contain any data

s/\|+/|/g;

This is assuming that the trailling pipe at the end of your first line of desired output is a typo.

Update: Too slow :-) Also, toolic's reply nudged me to remove the unnecessary escape in the replacement string.

  • Comment on Re: how to remove empty pipe delimiters in a line which doesn't contain any data
  • Download Code