title: Remove ^@ Characters in a Unix File
body: <p>I have a question about removing invisible characters which can be only be seen when we try to view the file using &quot;vi&quot; command. We have a file that's being generated by Datastage Application (Source is a DB2 Table -&gt; Target is a .txt File).  File has data with different data types. I'm having an issue with just 3 columns which have their datatypes defined as CHAR.</p>
  <p>If you open the file in a Textpad you'd see spaces. But when you view the same file on Unix via vi command, we see ^@ characters in blue color. My file is a delimiter file with the delimiter as ^@^ (I know it's kinda sounds weird) .</p>
  <p>I have tried:</p>
  <ol>
  <li><code>tr -d [:cntrl:] &lt;Filename &gt;NewFileName</code> — Still no luck — [Delimiters are removed but the spaces remain]</li>
  <li><code>tr -s &quot;^@&quot; &lt;Filename &gt;NewFilename</code> — Still no luck — I see file reduce in file size but the invisible characters still stay.</li>
  <li>Tried changing the delimiter — but still see the same invisible characters.</li>
  <li>Used <code>sed &quot;s/^@/g/&quot;</code> (and other sed commands) <code>&lt;Filename</code>  — still no luck.</li>
  </ol>
  <p>Any suggestions are really appreciated. I have researched the posts on this website but I couldn't find one. If it's a simple please excuse me and share your thoughts.</p>