title: Windows batch remove string and newline
body: <p>I have a file that, after a lot of playing around with windows batch, I managed to get the output in this format:</p>
  <pre><code>checksum=d0ea0cf465e3cdaws42d43fc3c5b17 *file_1020.csv
  |mode=standard
  </code></pre>
  <p>I need to remove the  *file_1020.csv and the trailing newline to get the output in a single line:</p>
  <pre><code>checksum=d0ea0cf465e3cdaws42d43fc3c5b17|mode=standard
  </code></pre>
  <p>Can you help me with the command that does this, I have searched and tried several things like set /p but none of them worked. My code is</p>
  <pre><code>echo|set /p=&quot;checksum=&quot;&gt;file_1020.csv_tmp 
  md5sum file_1020.csv&gt;&gt;file_1020.csv_tmp 
  echo|set /p=&quot;|mode=standard&quot; &lt; nul &gt;&gt; file_1020.csv_tmp
  </code></pre>