title: sed command not working ...how to strip a pipe out
body: <p>I have a data file I am trying to import into redshift (postgress mpp database).  I am trying to import into postgres with a '|' delimiter.  But some data,  has the '|' in the string data itself, for example :</p>
  
  <pre><code>73779087|"UCGr4c0_zShyHbctxJJrJ03w"|"ItsMattSpeaking | SuPra" 
  </code></pre>
  
  <p>So I tried this sed command :</p>
  
  <pre><code>sed -i -E "s/(.+|)(.+|)|/\1\2\\|/g" inputfile.txt &gt;outputfile.txt
  </code></pre>
  
  <p>Any ideas on what is wrong with the sed command, to replace the | in the last string with a \| escape character so that Redshift will not view this as a delimiter ?  Any help is appreciated.</p>