<p>I have a file like this:</p>

<p>"</p>

<pre><code>DGM97JN1_135:2:1101:1283:2110    16    chr13.fa    ...

DGM97JN1_135:2:1101:1434:2186    16    chr08.fa    ...

DGM97JN1_135:2:1101:1385:2244    0    chr16.fa    ...

DGM97JN1_135:2:1101:1663:2038    0    chr13.fa    ...

...........
</code></pre>

<p>"</p>

<p>and I would like to use a fast and easy way to delete the ".fa" after chromosome names in each row of the third column. How I do it now is </p>

<pre><code>                   cat &lt;input file&gt; | tr -d '.fa'
</code></pre>

<p>But it does not works well, since it will also delete all "." in the file for some reasons, why this would happen and what is the right way to code it?</p>

<p>Besides since it is a large file, I wonder if there is a way I can narrow down the searching and substituting on only third column and therefore accelerate the process? </p>

<p>you need <strong>sed</strong>, not <strong>tr</strong></p>
<p>try:</p>
<pre><code> sed 's/\.fa//'  &lt;input file&gt;
</code></pre>