title: Removing milliseconds from timestamp on specific columns
body: <p>I am trying to remove the milliseconds from both timestamps( columns 8 and 9) </p>
  
  <pre><code>1       20  2   14000   14000 11    1   10:11:56.136    10:11:56.136    0   1 
  </code></pre>
  
  <p>I  have been using the following sed command to remove them:</p>
  
  <pre><code> sed 's/\(:[0-9][0-9]\)\.[0-9]\{3\}/\1/g' 
  </code></pre>
  
  <p>This worked really well. However I noticed that in my file I have other time stamps where I only have two milliseconds and some with one millisecond:</p>
  
  <pre><code>**10:46:27.93   10:46:27.90** and some with only one millisecond 10:46:2     10:46:2
  </code></pre>
  
  <p>I ran my sed command again  in order to remove two milliseconds on the file that I had removed the  three milliseconds. Like this:</p>
  
  <pre><code>sed 's/\(:[0-9][0-9]\)\.[0-9]\{2\}/\1/g'
  </code></pre>
  
  <p>This works fine because I see that it removes the two milliseconds from the time.</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>After running the above command, I see that it is also sometimes modifying some of my other columns. I am not including all of my columns because it would be difficult to read. I have around 40 columns. I only want to modify the columns 8 and 9. </p>
  
  <p><strong>Question</strong> </p>
  
  <p>How can I take care of all three cases with one command. When I say three cases I mean when having two milliseconds, one milliseconds and three milliseconds. Also, how can make sure I <strong>ONLY</strong> modify columns 8 and 9.</p>
  
  <p>Any help is really appreciated. Thank you!!!</p>