C# Reading a file and writing out replacing string
<p>What I have is a C# windows app that reads a bunch of SQL tables and creates a bunch of queries based on the results.  What I'm having a small issue with is the final "," on my query</p>

<p>This is what I have</p>

<pre><code>ColumnX,

from
</code></pre>

<p>I need to read the entire file, write out exactly what is in the file and just replace the last , before the from with nothing.  </p>

<p>I tried <code>.replace(@",\n\nfrom),(@"\n\nfrom)</code> but it's not finding it.  Any help is appreciated.</p>

<p>Example:</p>

<pre><code>ColumnX,

from
</code></pre>

<p>Result:</p>

<pre><code>ColumnX

from
</code></pre>
