title: replace last occurrence of string from csv using sed command
body: <p>So I am using report builder to generate csv file, which I need to format so that it displays the totals and subtotals correctly. Note totals and subtotal are calculated with report builder.
  My csv when not formatted correctly. Below is the input file(.csv)
  <a href="https://i.stack.imgur.com/bbfSA.png" rel="nofollow noreferrer">InputFile</a>
  Expected output: <a href="https://i.stack.imgur.com/s9gML.png" rel="nofollow noreferrer">ExpectedResult</a></p>
  <p>Following command didn't work as the input file has last line as CRLF.<br />
  Update last line:</p>
  <pre><code>sed '$s/003/003,,,,,,,Total,/' $InputFile.csv &gt; $InputFile.csv.tmp
  </code></pre>