title: How to remove values from text file from different position
body: <p>I have a file containing different values:</p>
  <pre><code>30,-4,098511E-02
  30,05,-4,098511E-02
  41,9,15,54288
  </code></pre>
  <p>I need to remove values from this file but from different position, for example:</p>
  <pre><code>30
  30,05
  41,9
  </code></pre>
  <p>I tried to do it with <code>sed</code> to remove the last value but my problem is when I encounter the <code>41,9,15,54288</code> it does not work. Any idea if there is a way to do it?</p>
  <p>I tried this</p>
  <pre><code>echo &quot;30,-4,098511E-02&quot; | sed 's/,.*/,/'
  </code></pre>